mirror of
https://github.com/rust-lang/rust.git
synced 2024-10-30 22:12:15 +00:00
Don't delay ReError bug during lexical region resolve
This commit is contained in:
parent
f722b24eb9
commit
90cf0cc6c2
@ -1046,7 +1046,7 @@ impl<'tcx> LexicalRegionResolutions<'tcx> {
|
||||
ty::ReVar(rid) => match self.values[rid] {
|
||||
VarValue::Empty(_) => r,
|
||||
VarValue::Value(r) => r,
|
||||
VarValue::ErrorValue => tcx.mk_re_error_misc(),
|
||||
VarValue::ErrorValue => tcx.lifetimes.re_static,
|
||||
},
|
||||
_ => r,
|
||||
};
|
||||
|
22
tests/ui/regions/resolve-re-error-ice.rs
Normal file
22
tests/ui/regions/resolve-re-error-ice.rs
Normal file
@ -0,0 +1,22 @@
|
||||
// check-pass
|
||||
|
||||
// Allow this for now, can remove this UI test when this becomes a hard error.
|
||||
#![allow(implied_bounds_entailment)]
|
||||
|
||||
use std::collections::hash_map::{Keys, HashMap};
|
||||
use std::marker::PhantomData;
|
||||
|
||||
trait MapAssertion<'a, K, V, R> {
|
||||
fn key_set(&self) -> Subject<Keys<K, V>, (), R>;
|
||||
}
|
||||
|
||||
struct Subject<'a, T, V, R>(PhantomData<(&'a T, V, R)>);
|
||||
|
||||
impl<'a, K, V, R> MapAssertion<'a, K, V, R> for Subject<'a, HashMap<K, V>, (), R>
|
||||
{
|
||||
fn key_set(&self) -> Subject<'a, Keys<K, V>, (), R> {
|
||||
todo!()
|
||||
}
|
||||
}
|
||||
|
||||
fn main() {}
|
15
tests/ui/regions/resolve-re-error-ice.stderr
Normal file
15
tests/ui/regions/resolve-re-error-ice.stderr
Normal file
@ -0,0 +1,15 @@
|
||||
Future incompatibility report: Future breakage diagnostic:
|
||||
warning: impl method assumes more implied bounds than the corresponding trait method
|
||||
--> $DIR/resolve-re-error-ice.rs:17:16
|
||||
|
|
||||
LL | fn key_set(&self) -> Subject<'a, Keys<K, V>, (), R> {
|
||||
| ^^^^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: replace this type to make the impl signature compatible: `Subject<'_, std::collections::hash_map::Keys<'_, K, V>, (), R>`
|
||||
|
|
||||
= warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release!
|
||||
= note: for more information, see issue #105572 <https://github.com/rust-lang/rust/issues/105572>
|
||||
note: the lint level is defined here
|
||||
--> $DIR/resolve-re-error-ice.rs:4:10
|
||||
|
|
||||
LL | #![allow(implied_bounds_entailment)]
|
||||
| ^^^^^^^^^^^^^^^^^^^^^^^^^
|
||||
|
Loading…
Reference in New Issue
Block a user