Foreign types are trivially drop

- Also rename a trivial_const_drop to match style of other functions in
  the util module.
- Also add a test for `const Drop` that doesn't depend on a `~const`
  bound.
- Also comment a bit why we remove the const bound during dropck impl
  check.
This commit is contained in:
Michael Goulet
2022-01-19 20:07:04 -08:00
parent 8547f5732c
commit b7e4433974
6 changed files with 31 additions and 17 deletions

View File

@@ -1133,7 +1133,8 @@ impl<'cx, 'tcx> SelectionContext<'cx, 'tcx> {
| ty::Ref(..)
| ty::FnDef(..)
| ty::FnPtr(_)
| ty::Never => {}
| ty::Never
| ty::Foreign(_) => {}
// These types are built-in, so we can fast-track by registering
// nested predicates for their constituient type(s)