Commit Graph

222 Commits

Author SHA1 Message Date
Jack Huey e09242d5b8 Final bits 2022-09-16 17:47:53 -04:00
Jack Huey 92b759f517 Revert "Better errors for implied static bound"
This reverts commit c75817b0a7.
2022-09-16 09:47:07 -04:00
est31 173eb6f407 Only enable the let_else feature on bootstrap
On later stages, the feature is already stable.

Result of running:

rg -l "feature.let_else" compiler/ src/librustdoc/ library/ | xargs sed -s -i "s#\\[feature.let_else#\\[cfg_attr\\(bootstrap, feature\\(let_else\\)#"
2022-09-15 21:06:45 +02:00
bors 6153d3cbe6 Auto merge of #101212 - eholk:dyn-star, r=compiler-errors
Initial implementation of dyn*

This PR adds extremely basic and incomplete support for [dyn*](https://smallcultfollowing.com/babysteps//blog/2022/03/29/dyn-can-we-make-dyn-sized/). The goal is to get something in tree behind a flag to make collaboration easier, and also to make sure the implementation so far is not unreasonable. This PR does quite a few things:

* Introduce `dyn_star` feature flag
* Adds parsing for `dyn* Trait` types
* Defines `dyn* Trait` as a sized type
* Adds support for explicit casts, like `42usize as dyn* Debug`
  * Including const evaluation of such casts
* Adds codegen for drop glue so things are cleaned up properly when a `dyn* Trait` object goes out of scope
* Adds codegen for method calls, at least for methods that take `&self`

Quite a bit is still missing, but this gives us a starting point. Note that this is never intended to become stable surface syntax for Rust, but rather `dyn*` is planned to be used as an implementation detail for async functions in dyn traits.

Joint work with `@nikomatsakis` and `@compiler-errors.`

r? `@bjorn3`
2022-09-14 18:10:51 +00:00
Jack Huey c75817b0a7 Better errors for implied static bound 2022-09-13 20:18:04 -04:00
Eric Holk cf04547b0b Address code review comments 2022-09-13 14:50:12 -07:00
Eric Holk 6c01273a15 Plumb dyn trait representation through ty::Dynamic 2022-09-12 16:55:55 -07:00
Jack Huey 1ca9eb8ec3 Remove ReEmpty 2022-09-08 20:55:55 -04:00
Dezhi Wu b1430fb7ca Fix a bunch of typo
This PR will fix some typos detected by [typos].

I only picked the ones I was sure were spelling errors to fix, mostly in
the comments.

[typos]: https://github.com/crate-ci/typos
2022-08-31 18:24:55 +08:00
Jack Huey 8033c3c27d Various changes to logging of borrowck-related code 2022-08-29 10:59:21 -04:00
5225225 09ea9f0a87 Add diagnostic translation lints to crates that don't emit them 2022-08-18 19:29:02 +01:00
Matthias Krüger 01ccde5ec8
Rollup merge of #100095 - jackh726:early-binder, r=lcnr
More EarlyBinder cleanups

Each commit is independent

r? types
2022-08-04 22:25:04 +02:00
Matthias Krüger 0de7f756f0
Rollup merge of #99746 - compiler-errors:more-trait-engine, r=jackh726
Use `TraitEngine` in more places that don't specifically need `FulfillmentContext::new_in_snapshot`

Not sure if this change is worthwhile, but couldn't hurt re: chalkification

r? types
2022-08-03 22:29:27 +02:00
Jack Huey e21624dc80 Add bound_predicates_of and bound_explicit_predicates_of 2022-08-02 22:44:08 -04:00
bors 06f4950cbd Auto merge of #100032 - BoxyUwU:no_ty_in_placeholder_const, r=compiler-errors
make `PlaceholderConst` not store the type of the const

Currently the `Placeholder` variant on `ConstKind` is 28 bytes when with this PR its 8 bytes, i am not sure this is really useful at all rn since `Unevaluated` and `Value` variants are huge still but eventually it should be possible to get both down to 16 bytes 🤔. Mostly opening this to see if this change has any perf impact when done before it can make `ConstKind`/`ConstS` smaller
2022-08-02 13:10:49 +00:00
Camille GILLOT d7ea161b7e Remove DefId from AssocItemContainer. 2022-08-01 21:38:45 +02:00
Ellen 825a7cc65c make `PlaceholderConst` not store the type of the const 2022-08-01 15:42:38 +01:00
Dylan DPC 91b8b9ba4b
Rollup merge of #99714 - ouz-a:issue_57961, r=oli-obk
Fix regression introduced with #99383

Fixes #99642
2022-07-28 16:38:30 +05:30
ouz-a 8716eae3b1 add tests and comment 2022-07-27 14:43:46 +03:00
Michael Goulet 58f107ab56 Use TraitEngine in more places that don't specifically need FulfillmentCtxt::new_in_snapshot 2022-07-26 04:55:06 +00:00
ouz-a 4a0473c0f5 Bubble up obligations 2022-07-25 15:45:36 +03:00
Michael Woerister 88f6c6d8a0 Remove unused StableMap and StableSet types from rustc_data_structures 2022-07-20 13:11:39 +02:00
Alan Egerton 4f0a64736b
Update TypeVisitor paths 2022-07-06 06:41:53 +01:00
Alan Egerton e9e5d0685b
Relax constrained generics to TypeVisitable 2022-07-05 22:25:43 +01:00
bors 66c83ffca1 Auto merge of #98558 - nnethercote:smallvec-1.8.1, r=lqd
Update `smallvec` to 1.8.1.

This pulls in https://github.com/servo/rust-smallvec/pull/282, which
gives some small wins for rustc.

r? `@lqd`
2022-06-29 09:11:29 +00:00
Jack Huey e16dbb5076 Make empty bounds lower to WellFormed and make WellFormed coinductive 2022-06-28 00:17:40 -04:00
Nicholas Nethercote 7c40661ddb Update `smallvec` to 1.8.1.
This pulls in https://github.com/servo/rust-smallvec/pull/282, which
gives some small wins for rustc.
2022-06-27 08:48:55 +10:00
b-naber 705d818bd5 implement valtrees as the type-system representation for constant values 2022-06-14 16:07:11 +02:00
Nicholas Nethercote 93e4b6ef06 Rename the `ConstS::val` field as `kind`.
And likewise for the `Const::val` method.

Because its type is called `ConstKind`. Also `val` is a confusing name
because `ConstKind` is an enum with seven variants, one of which is
called `Value`. Also, this gives consistency with `TyS` and `PredicateS`
which have `kind` fields.

The commit also renames a few `Const` variables from `val` to `c`, to
avoid confusion with the `ConstKind::Value` variant.
2022-06-14 13:06:44 +10:00
Nicholas Nethercote 90db033955 Folding revamp.
This commit makes type folding more like the way chalk does it.

Currently, `TypeFoldable` has `fold_with` and `super_fold_with` methods.
- `fold_with` is the standard entry point, and defaults to calling
  `super_fold_with`.
- `super_fold_with` does the actual work of traversing a type.
- For a few types of interest (`Ty`, `Region`, etc.) `fold_with` instead
  calls into a `TypeFolder`, which can then call back into
  `super_fold_with`.

With the new approach, `TypeFoldable` has `fold_with` and
`TypeSuperFoldable` has `super_fold_with`.
- `fold_with` is still the standard entry point, *and* it does the
  actual work of traversing a type, for all types except types of
  interest.
- `super_fold_with` is only implemented for the types of interest.

Benefits of the new model.
- I find it easier to understand. The distinction between types of
  interest and other types is clearer, and `super_fold_with` doesn't
  exist for most types.
- With the current model is easy to get confused and implement a
  `super_fold_with` method that should be left defaulted. (Some of the
  precursor commits fixed such cases.)
- With the current model it's easy to call `super_fold_with` within
  `TypeFolder` impls where `fold_with` should be called. The new
  approach makes this mistake impossible, and this commit fixes a number
  of such cases.
- It's potentially faster, because it avoids the `fold_with` ->
  `super_fold_with` call in all cases except types of interest. A lot of
  the time the compile would inline those away, but not necessarily
  always.
2022-06-08 09:24:03 +10:00
Jack Huey 410dcc9674 Fully stabilize NLL 2022-06-03 17:16:41 -04:00
Jacob Pratt 49c82f31a8
Remove `crate` visibility usage in compiler 2022-05-20 20:04:54 -04:00
Jack Huey 0247faed29 Add bound_impl_trait_ref 2022-05-13 18:27:40 -04:00
Jack Huey c92248ab9f Add bound_type_of 2022-05-13 18:27:18 -04:00
Jack Huey 319575ae8c Introduce EarlyBinder 2022-05-10 22:47:18 -04:00
Oli Scherer 1163aa7e72 Remove opaque type obligation and just register opaque types as they are encountered.
This also registers obligations for the hidden type immediately.
2022-03-28 16:57:45 +00:00
Oli Scherer 264cd05b16 Revert "Auto merge of #93893 - oli-obk:sad_revert, r=oli-obk"
This reverts commit 6499c5e7fc, reversing
changes made to 78450d2d60.
2022-03-28 16:27:14 +00:00
InfRandomness 645620b3b3 Swap DtorckConstraint to DropckConstraint
This change was made as per suspicion that this struct was never renamed after consistent use of DropCk.

This also clarifies the meaning behind the name of this structure.
2022-03-24 20:35:35 +01:00
Michael Goulet 376d100e74 make rustc work again 2022-03-23 21:52:17 -07:00
Michael Goulet cc5885552e upgrade chalk 2022-03-23 00:01:20 -07:00
Nicholas Nethercote ca5525d564 Improve `AdtDef` interning.
This commit makes `AdtDef` use `Interned`. Much the commit is tedious
changes to introduce getter functions. The interesting changes are in
`compiler/rustc_middle/src/ty/adt.rs`.
2022-03-11 13:31:24 +11:00
Dario Nieuwenhuis b8bd9978e1 chalk/db: use correct debrujin index when replacing opaque type. 2022-02-22 00:16:56 +01:00
Dario Nieuwenhuis c6f5c7ba60 chalk/lowering: lower generator types. 2022-02-21 23:27:08 +01:00
lcnr 1245131a11 use `List<Ty<'tcx>>` for tuples 2022-02-21 07:09:11 +01:00
est31 2ef8af6619 Adopt let else in more places 2022-02-19 17:27:43 +01:00
Nicholas Nethercote a95fb8b150 Overhaul `Const`.
Specifically, rename the `Const` struct as `ConstS` and re-introduce `Const` as
this:
```
pub struct Const<'tcx>(&'tcx Interned<ConstS>);
```
This now matches `Ty` and `Predicate` more closely, including using
pointer-based `eq` and `hash`.

Notable changes:
- `mk_const` now takes a `ConstS`.
- `Const` was copy, despite being 48 bytes. Now `ConstS` is not, so need a
  we need separate arena for it, because we can't use the `Dropless` one any
  more.
- Many `&'tcx Const<'tcx>`/`&Const<'tcx>` to `Const<'tcx>` changes
- Many `ct.ty` to `ct.ty()` and `ct.val` to `ct.val()` changes.
- Lots of tedious sigil fiddling.
2022-02-15 16:19:59 +11:00
Nicholas Nethercote 7eb15509ce Remove unnecessary `RegionKind::` quals.
The variant names are exported, so we can use them directly (possibly
with a `ty::` qualifier). Lots of places already do this, this commit
just increases consistency.
2022-02-15 16:14:24 +11:00
Nicholas Nethercote 7024dc523a Overhaul `RegionKind` and `Region`.
Specifically, change `Region` from this:
```
pub type Region<'tcx> = &'tcx RegionKind;
```
to this:
```
pub struct Region<'tcx>(&'tcx Interned<RegionKind>);
```

This now matches `Ty` and `Predicate` more closely.

Things to note
- Regions have always been interned, but we haven't been using pointer-based
  `Eq` and `Hash`. This is now happening.
- I chose to impl `Deref` for `Region` because it makes pattern matching a lot
  nicer, and `Region` can be viewed as just a smart wrapper for `RegionKind`.
- Various methods are moved from `RegionKind` to `Region`.
- There is a lot of tedious sigil changes.
- A couple of types like `HighlightBuilder`, `RegionHighlightMode` now have a
  `'tcx` lifetime because they hold a `Ty<'tcx>`, so they can call `mk_region`.
- A couple of test outputs change slightly, I'm not sure why, but the new
  outputs are a little better.
2022-02-15 16:08:52 +11:00
Nicholas Nethercote 925ec0d3c7 Overhaul `PredicateInner` and `Predicate`.
Specifically, change `Ty` from this:
```
pub struct Predicate<'tcx> { inner: &'tcx PredicateInner<'tcx> }
```
to this:
```
pub struct Predicate<'tcx>(&'tcx Interned<PredicateS<'tcx>>)
```
where `PredicateInner` is renamed as `PredicateS`.

 This (plus a few other minor changes) makes the parallels with `Ty` and
`TyS` much clearer, and makes the uniqueness more explicit.
2022-02-15 16:03:26 +11:00
Nicholas Nethercote e9a0c429c5 Overhaul `TyS` and `Ty`.
Specifically, change `Ty` from this:
```
pub type Ty<'tcx> = &'tcx TyS<'tcx>;
```
to this
```
pub struct Ty<'tcx>(Interned<'tcx, TyS<'tcx>>);
```
There are two benefits to this.
- It's now a first class type, so we can define methods on it. This
  means we can move a lot of methods away from `TyS`, leaving `TyS` as a
  barely-used type, which is appropriate given that it's not meant to
  be used directly.
- The uniqueness requirement is now explicit, via the `Interned` type.
  E.g. the pointer-based `Eq` and `Hash` comes from `Interned`, rather
  than via `TyS`, which wasn't obvious at all.

Much of this commit is boring churn. The interesting changes are in
these files:
- compiler/rustc_middle/src/arena.rs
- compiler/rustc_middle/src/mir/visit.rs
- compiler/rustc_middle/src/ty/context.rs
- compiler/rustc_middle/src/ty/mod.rs

Specifically:
- Most mentions of `TyS` are removed. It's very much a dumb struct now;
  `Ty` has all the smarts.
- `TyS` now has `crate` visibility instead of `pub`.
- `TyS::make_for_test` is removed in favour of the static `BOOL_TY`,
  which just works better with the new structure.
- The `Eq`/`Ord`/`Hash` impls are removed from `TyS`. `Interned`s impls
  of `Eq`/`Hash` now suffice. `Ord` is now partly on `Interned`
  (pointer-based, for the `Equal` case) and partly on `TyS`
  (contents-based, for the other cases).
- There are many tedious sigil adjustments, i.e. adding or removing `*`
  or `&`. They seem to be unavoidable.
2022-02-15 16:03:24 +11:00
Matthew Jasper 1e6d38230f Reverse parameter to placeholder substitution in chalk results 2022-02-11 21:38:17 +00:00
Matthew Jasper d4fa173ed3 Fix more chalk lowering issues
- Implement lowering for subtype goals
- Use correct lang item for Generator trait
- Use `lower_into` for lowering `ty::Variance`
2022-02-11 21:38:17 +00:00
Matthew Jasper cb3cff3761 Stop using a placeholder for empty regions in Chalk 2022-02-11 21:38:16 +00:00
Oli Scherer d54195db22 Revert "Auto merge of #92007 - oli-obk:lazy_tait2, r=nikomatsakis"
This reverts commit e7cc3bddbe, reversing
changes made to 734368a200.
2022-02-11 07:18:06 +00:00
Camille GILLOT 8edd32c940 Avoid clone. 2022-02-09 20:11:33 +01:00
Camille GILLOT 6c2ee885e6 Ensure that queries only return Copy types. 2022-02-09 20:07:38 +01:00
Oli Scherer 0f6e06b7c0 Lazily resolve type-alias-impl-trait defining uses
by using an opaque type obligation to bubble up comparisons between opaque types and other types

Also uses proper obligation causes so that the body id works, because out of some reason nll uses body ids for logic instead of just diagnostics.
2022-02-02 15:40:11 +00:00
kadmin bd03d8167f Remove generalization over projection
Instead, just use a term everywhere.
2022-01-28 00:25:36 +00:00
pierwill 8d27c28e39 ⬆ chalk to 0.76.0 2022-01-19 13:44:43 -06:00
bors 7bc7be860f Auto merge of #87648 - JulianKnodt:const_eq_constrain, r=oli-obk
allow eq constraints on associated constants

Updates #70256

(cc `@varkor,` `@Centril)`
2022-01-18 09:58:39 +00:00
Matthias Krüger cb5ecff8b2
Rollup merge of #92640 - compiler-errors:array-deref-on-newtype, r=lcnr
Fix ICEs related to `Deref<Target=[T; N]>` on newtypes

1. Stash a const infer's type into the canonical var during canonicalization, so we can recreate the fresh const infer with that same type.
    For example, given `[T; _]` we know `_` is a `usize`. If we go from infer => canonical => infer, we shouldn't forget that variable is a usize.
Fixes #92626
Fixes #83704

2. Don't stash the autoderef'd slice type that we get from method lookup, but instead recreate it during method confirmation. We need to do this because the type we receive back after picking the method references a type variable that does not exist after probing is done.
Fixes #92637

... A better solution for the second issue would be to actually _properly_ implement `Deref` for `[T; N]` instead of fixing this autoderef hack to stop leaking inference variables. But I actually looked into this, and there are many complications with const impls.
2022-01-18 04:41:58 +01:00
kadmin 1c1ce2fbda Add term to ExistentialProjection
Also prevent ICE when adding a const in associated const equality.
2022-01-17 20:01:22 +00:00
kadmin e7529d6a38 Update term for use in more places
Replace use of `ty()` on term and use it in more places. This will allow more flexibility in the
future, but slightly worried it allows items which are consts which only accept types.
2022-01-17 19:59:40 +00:00
kadmin 67f56671d0 Use Term in ProjectionPredicate
ProjectionPredicate should be able to handle both associated types and consts so this adds the
first step of that. It mainly just pipes types all the way down, not entirely sure how to handle
consts, but hopefully that'll come with time.
2022-01-17 17:44:56 +00:00
Ellen 71bbb603f4 initial revert 2022-01-15 01:16:55 +00:00
Michael Goulet 012910dab2 Canonicalize const variables correctly 2022-01-12 08:27:41 -08:00
Matthew Jasper d7595853a2 Add `trait_item_def_id` to `AssocItem`
This allows avoiding some lookups by name
2022-01-07 12:28:12 -08:00
bors e670844012 Auto merge of #91929 - anuvratsingh:remove_in_band_lifetimes_compiler_rustc_traits, r=jackh726
Removed `in_band_lifetimes` from `rustc_traits`

Issue: [#91867](https://github.com/rust-lang/rust/issues/91867)
2021-12-31 05:08:24 +00:00
Anuvrat 58a888fcc1
Removed `in_band_lifetimes` from `rustc_traits` 2021-12-30 13:59:19 -05:00
bors c1d301bb29 Auto merge of #92167 - pierwill:chalk-update, r=jackh726
Update chalk to 0.75.0

- Compute flags in `intern_ty`
- Remove `tracing-serde` from `PERMITTED_DEPENDENCIES`
- Bump `tracing-tree` to 0.2.0
- Bump `tracing-subscriber` to 0.3.3
2021-12-23 08:59:55 +00:00
pierwill ea25b779eb Update chalk to 0.75.0
- Compute flags in `intern_ty`
- Remove tracing-serde from PERMITTED_DEPENDENCIES
- Disable `tracing-full` feature in `chalk-solve`
- Bump tracing-tree to 0.2.0
2021-12-22 10:07:44 -06:00
b-naber 399ab40dbd get rid of normalize_generic_arg... queries 2021-12-13 23:05:25 +01:00
b-naber 8250eef685 normalize_generic_arg_after in terms of try version 2021-12-13 23:04:09 +01:00
Alan Egerton bfc434b6d0
Reduce boilerplate around infallible folders 2021-12-02 16:14:16 +00:00
b-naber ff448cfcee implement version of normalize_erasing_regions that doesn't assume value is normalizable 2021-12-01 12:12:38 +01:00
LeSeulArtichaut 30bf20a692
Unwrap the results of type folders
Co-authored-by: Alan Egerton <eggyal@gmail.com>
2021-11-26 07:38:25 +00:00
LeSeulArtichaut 6dc3dae46f
Adapt `TypeFolder` implementors to return a `Result`
Co-authored-by: Alan Egerton <eggyal@gmail.com>
2021-11-26 07:25:16 +00:00
Deadbeef f1126f1272
Make select_* methods return Vec for TraitEngine 2021-11-08 23:35:23 +08:00
jackh726 2b5b456e23 Move some outlives bounds things from rustc_trait_selection to rustc_typeck 2021-10-15 12:14:19 -04:00
jackh726 a7c132de55 Move push_outlives_components to rustc_infer 2021-10-15 12:13:35 -04:00
Matthias Krüger e6f77a1787 clippy::complexity fixes 2021-10-08 20:07:44 +02:00
Aaron Hill 93ab12eeab
Improve cause information for NLL higher-ranked errors
This PR has several interconnected pieces:

1. In some of the NLL region error code, we now pass
   around an `ObligationCause`, instead of just a plain `Span`.
   This gets forwarded into `fulfill_cx.register_predicate_obligation`
   during error reporting.
2. The general InferCtxt error reporting code is extended to
   handle `ObligationCauseCode::BindingObligation`
3. A new enum variant `ConstraintCategory::Predicate` is added.
   We try to avoid using this as the 'best blame constraint' - instead,
   we use it to enhance the `ObligationCause` of the `BlameConstraint`
   that we do end up choosing.

As a result, several NLL error messages now contain the same
"the lifetime requirement is introduced here" message as non-NLL
errors.

Having an `ObligationCause` available will likely prove useful
for future improvements to NLL error messages.
2021-09-27 10:23:45 -05:00
Jubilee ee2e97c416
Rollup merge of #89001 - jackh726:binder-cleanup, r=nikomatsakis
Be explicit about using Binder::dummy

This is somewhat of a late followup to the binder refactor PR. It removes `ToPredicate` and `ToPolyTraitImpls` that hide the use of `Binder::dummy`. While this does make code a bit more verbose, it allows us be more careful about where we create binders.

Another alternative here might be to add a new trait `ToBinder` or something with a `dummy()` fn. Which could still allow grepping but allows doing something like `trait_ref.dummy()` (but I also wonder if longer-term, it would be better to be even more explicit with a `bind_with_vars(ty::List::empty())` *but* that's not clear yet.

r? ``@nikomatsakis``
2021-09-24 11:40:11 -07:00
Mark Rousskov c746be2219 Migrate to 2021 2021-09-20 22:21:42 -04:00
jackh726 be76bdf905 Remove ToPredicate impls that use Binder::dummy 2021-09-15 20:54:50 -04:00
bors d5cd3205fd Auto merge of #88371 - Manishearth:rollup-pkkjsme, r=Manishearth
Rollup of 11 pull requests

Successful merges:

 - #87832 (Fix debugger stepping behavior with `match` expressions)
 - #88123 (Make spans for tuple patterns in E0023 more precise)
 - #88215 (Reland #83738: "rustdoc: Don't load all extern crates unconditionally")
 - #88216 (Don't stabilize creation of TryReserveError instances)
 - #88270 (Handle type ascription type ops in NLL HRTB diagnostics)
 - #88289 (Fixes for LLVM change 0f45c16f2caa7c035e5c3edd40af9e0d51ad6ba7)
 - #88320 (type_implements_trait consider obligation failure on overflow)
 - #88332 (Add argument types tait tests)
 - #88340 (Add `c_size_t` and `c_ssize_t` to `std::os::raw`.)
 - #88346 (Revert "Add type of a let tait test impl trait straight in let")
 - #88348 (Add field types tait tests)

Failed merges:

r? `@ghost`
`@rustbot` modify labels: rollup
2021-08-27 01:07:17 +00:00
Manish Goregaokar 1e94fe1a45
Rollup merge of #88270 - lqd:hrtb-type-ascription, r=nikomatsakis
Handle type ascription type ops in NLL HRTB diagnostics

Currently, there are still a few cases of the "higher-ranked subtype error" of yore, 4 of which are related to type ascription.

This PR is a follow-up to #86700, adding support for type ascription type ops, and makes 3 of these tests output the same diagnostics in NLL mode as the migrate mode (and 1 is now much closer, especially if you ignore that it already outputs an additional error in NLL mode -- which could be a duplicate caused by a lack of normalization like [these comments point out](9583fd1bdd/compiler/rustc_traits/src/type_op.rs (L122-L157)), or an imprecision in some parts of normalization as [described here](https://github.com/rust-lang/rust/pull/86700#discussion_r689086688)).

Since we discussed these recently:
- [here](https://github.com/rust-lang/rust/pull/86700#discussion_r689158868), cc ````@matthewjasper,````
- and [here](https://github.com/rust-lang/rust/issues/57374#issuecomment-901500856), cc ````@Aaron1011.````

It should only leave [this TAIT test](9583fd1bdd/src/test/ui/type-alias-impl-trait/issue-57611-trait-alias.rs) as still emitting [the terse error](9583fd1bdd/src/test/ui/type-alias-impl-trait/issue-57611-trait-alias.nll.stderr).

r? ````@estebank```` (so that they shake their fist at NLL's general direction less often) or ````@nikomatsakis```` or matthew or aaron, the more the merrier.
2021-08-26 12:38:09 -07:00
lcnr bfaf13af4e make unevaluated const substs optional 2021-08-26 11:00:30 +02:00
lcnr f4b606fd17 require a `tcx` for `TypeVisitor` 2021-08-26 10:54:01 +02:00
Rémy Rakic 820e2680ec handle ascription type op in NLL HRTB diagnostics
Refactors the `type_op_ascribe_user_type` query into a version which
accepts a span, and uses it in the nicer NLL HRTB bound region errors.
2021-08-23 23:31:01 +02:00
Frank Steffahn bf88b113ea Fix typos “a”→“an” 2021-08-22 15:35:11 +02:00
Niko Matsakis 947c0de028 introduce a Coerce predicate 2021-08-19 17:28:24 -04:00
bors 3d0774d0dc Auto merge of #86700 - lqd:matthews-nll-hrtb-errors, r=nikomatsakis
Matthew's work on improving NLL's "higher-ranked subtype error"s

This PR rebases `@matthewjasper's` [branch](https://github.com/matthewjasper/rust/tree/nll-hrtb-errors) which has great work to fix the obscure higher-ranked subtype errors that are tracked in #57374.

These are a blocker to turning full NLLs on, and doing some internal cleanups to remove some of the old region code.

The goal is so `@nikomatsakis` can take a look at this early, and I'll then do my best to help do the changes and followup work to land this work, and move closer to turning off the migration mode.

I've only updated the branch and made it compile, removed a warning or two.

r? `@nikomatsakis`

(Here's the [zulip topic to discuss this](https://rust-lang.zulipchat.com/#narrow/stream/122657-t-compiler.2Fwg-nll/topic/.2357374.3A.20improving.20higher-ranked.20subtype.20errors.20via.20.2386700) that Niko wanted)
2021-08-18 15:54:59 +00:00
Rémy Rakic 2cf4b87393 De-dupe NLL HRTB diagnostics' use of `type_op_prove_predicate` 2021-08-15 14:49:36 +02:00
Deadbeef f25d2bd53b
Assign FIXMEs to me and remove obsolete ones
Also fixed capitalization of documentation
2021-08-14 16:48:01 +00:00
Deadbeef a00f2bcf5c
Try to fix problem 2021-08-13 09:28:50 +00:00
Deadbeef 32390a0df6
move Constness into TraitPredicate 2021-08-13 09:26:33 +00:00
bors b53a93db2d Auto merge of #87535 - lf-:authors, r=Mark-Simulacrum
rfc3052 followup: Remove authors field from Cargo manifests

Since RFC 3052 soft deprecated the authors field, hiding it from
crates.io, docs.rs, and making Cargo not add it by default, and it is
not generally up to date/useful information for contributors, we may as well
remove it from crates in this repo.
2021-08-02 05:49:17 +00:00
Jade 3cf820e17d rfc3052: Remove authors field from Cargo manifests
Since RFC 3052 soft deprecated the authors field anyway, hiding it from
crates.io, docs.rs, and making Cargo not add it by default, and it is
not generally up to date/useful information, we should remove it from
crates in this repo.
2021-07-29 14:56:05 -07:00
Matthias Krüger aa74c75d84 clippy:: append_instead_of_extend 2021-07-25 12:26:02 +02:00