Skip to content

Rollup of 5 pull requests #72330

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 26 commits into from
May 19, 2020
Merged
Changes from 1 commit
Commits
Show all changes
26 commits
Select commit Hold shift + click to select a range
59cc5b1
Support coercion between (FnDef | Closure) and (FnDef | Closure) when…
ldm0 May 7, 2020
42396b1
Test for coercion between (FnDef | Closure) and (FnDef | Closure)
ldm0 May 7, 2020
1e4b663
Improve documentation for drop elaboration
jonas-schievink May 16, 2020
8b14b84
Assume unevaluated consts are equal to the other consts and add Const…
skinnyBat Feb 28, 2020
4cfdd21
Emit `ConstEquate` obligation after checking/unifying for inference v…
skinnyBat Jan 2, 2020
3ef8310
Add lazy normalization tests
skinnyBat Jan 4, 2020
93d15b9
Put lazy normalization behind a feature gate
skinnyBat Jan 4, 2020
c3a0cba
initial cleanup
lcnr May 5, 2020
e1a8d32
keep the good old lazy_normalization hack alive
lcnr May 5, 2020
afd7ea8
update tests and add relevant feature gate test
lcnr May 5, 2020
e873eef
explicitly handle errors in fulfill
lcnr May 7, 2020
479968b
explicitly handle errors in `select`
lcnr May 7, 2020
443ae83
merge lazy_normalization_consts into const_generics
lcnr May 15, 2020
0f7bf5d
add docs
lcnr May 8, 2020
3d7637e
correctly handle escaping bound variables
lcnr May 8, 2020
c714397
chalk
lcnr May 12, 2020
752d8a2
the best way to fix bugs is by ignoring them
lcnr May 12, 2020
6a72ba4
Logically seperate lazy norm from `const_generics`
lcnr May 17, 2020
1591196
Update linker-plugin-lto.md to contain up to rust 1.43
elichai May 17, 2020
9da8a5b
update tests
lcnr May 17, 2020
5b9941c
Add remote-test-client help text
tblah May 18, 2020
58e6447
Rollup merge of #71599 - ldm0:fnclo, r=nikomatsakis
Dylan-DPC May 18, 2020
c6030c9
Rollup merge of #71973 - lcnr:lazy-norm, r=nikomatsakis
Dylan-DPC May 18, 2020
4adb9a8
Rollup merge of #72283 - jonas-schievink:elaborate-drop-elaboration, …
Dylan-DPC May 18, 2020
0b63bc7
Rollup merge of #72290 - elichai:2020-doc-lto, r=wesleywiser
Dylan-DPC May 18, 2020
256ce18
Rollup merge of #72318 - tblah:remote-test-client-doc, r=nikomatsakis
Dylan-DPC May 18, 2020
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
explicitly handle errors in select
  • Loading branch information
lcnr committed May 17, 2020
commit 479968b81259ee7bfd3897cb192ff61b59fb8a8f
32 changes: 19 additions & 13 deletions src/librustc_trait_selection/traits/select.rs
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@ use crate::traits::project::ProjectionCacheKeyExt;
use rustc_ast::attr;
use rustc_data_structures::fx::{FxHashMap, FxHashSet};
use rustc_data_structures::stack::ensure_sufficient_stack;
use rustc_errors::ErrorReported;
use rustc_hir as hir;
use rustc_hir::def_id::DefId;
use rustc_hir::lang_items;
Expand Down Expand Up @@ -514,17 +515,15 @@ impl<'cx, 'tcx> SelectionContext<'cx, 'tcx> {

let evaluate = |c: &'tcx ty::Const<'tcx>| {
if let ty::ConstKind::Unevaluated(def_id, substs, promoted) = c.val {
match self.infcx.const_eval_resolve(
obligation.param_env,
def_id,
substs,
promoted,
Some(obligation.cause.span),
) {
Ok(val) => Ok(ty::Const::from_value(self.tcx(), val, c.ty)),
Err(ErrorHandled::TooGeneric) => Err(EvaluatedToAmbig),
Err(_) => Err(EvaluatedToErr),
}
self.infcx
.const_eval_resolve(
obligation.param_env,
def_id,
substs,
promoted,
Some(obligation.cause.span),
)
.map(|val| ty::Const::from_value(self.tcx(), val, c.ty))
} else {
Ok(c)
}
Expand All @@ -537,8 +536,15 @@ impl<'cx, 'tcx> SelectionContext<'cx, 'tcx> {
Err(_) => Ok(EvaluatedToErr),
}
}
(Err(EvaluatedToErr), _) | (_, Err(EvaluatedToErr)) => Ok(EvaluatedToErr),
_ => Ok(EvaluatedToAmbig),
(Err(ErrorHandled::Reported(ErrorReported)), _)
| (_, Err(ErrorHandled::Reported(ErrorReported))) => Ok(EvaluatedToErr),
(Err(ErrorHandled::Linted), _) | (_, Err(ErrorHandled::Linted)) => span_bug!(
obligation.cause.span(self.tcx()),
"ConstEquate: const_eval_resolve returned an unexpected error"
),
(Err(ErrorHandled::TooGeneric), _) | (_, Err(ErrorHandled::TooGeneric)) => {
Ok(EvaluatedToAmbig)
}
}
}
}
Expand Down