Skip to content

Commit 9d11084

Browse files
author
Lukas Markeffsky
committed
ReErased regions are local
1 parent 2a6ff72 commit 9d11084

File tree

3 files changed

+25
-2
lines changed

3 files changed

+25
-2
lines changed

compiler/rustc_type_ir/src/lib.rs

+2-1
Original file line numberDiff line numberDiff line change
@@ -220,7 +220,8 @@ bitflags! {
220220
// which is different from how types/const are freshened.
221221
| TypeFlags::HAS_TY_FRESH.bits
222222
| TypeFlags::HAS_CT_FRESH.bits
223-
| TypeFlags::HAS_FREE_LOCAL_REGIONS.bits;
223+
| TypeFlags::HAS_FREE_LOCAL_REGIONS.bits
224+
| TypeFlags::HAS_RE_ERASED.bits;
224225

225226
/// Does this have `Projection`?
226227
const HAS_TY_PROJECTION = 1 << 10;
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
// build-pass
2+
3+
#![crate_type = "lib"]
4+
5+
pub trait StreamOnce {
6+
type Error;
7+
}
8+
9+
pub trait ResetStream: StreamOnce {
10+
fn reset(&mut self) -> Result<(), Self::Error>;
11+
}
12+
13+
impl<'a> ResetStream for &'a str
14+
where Self: StreamOnce
15+
{
16+
#[inline]
17+
fn reset(&mut self) -> Result<(), Self::Error> {
18+
Ok(())
19+
}
20+
}

tests/ui/recursion/issue-83150.stderr

+3-1
Original file line numberDiff line numberDiff line change
@@ -9,9 +9,11 @@ LL | func(&mut iter.map(|x| x + 1))
99
= help: a `loop` may express intention better if this is on purpose
1010
= note: `#[warn(unconditional_recursion)]` on by default
1111

12-
error[E0275]: overflow evaluating the requirement `Map<&mut Map<&mut Map<&mut Map<..., ...>, ...>, ...>, ...>: Iterator`
12+
error[E0275]: overflow evaluating the requirement `Map<&mut std::ops::Range<u8>, [closure@$DIR/issue-83150.rs:12:24: 12:27]>: Iterator`
1313
|
1414
= help: consider increasing the recursion limit by adding a `#![recursion_limit = "256"]` attribute to your crate (`issue_83150`)
15+
= note: required for `&mut Map<&mut std::ops::Range<u8>, [closure@$DIR/issue-83150.rs:12:24: 12:27]>` to implement `Iterator`
16+
= note: 65 redundant requirements hidden
1517
= note: required for `&mut Map<&mut Map<&mut Map<&mut Map<&mut Map<&mut Map<&mut Map<..., ...>, ...>, ...>, ...>, ...>, ...>, ...>` to implement `Iterator`
1618
= note: the full type name has been written to '$TEST_BUILD_DIR/recursion/issue-83150/issue-83150.long-type-hash.txt'
1719

0 commit comments

Comments
 (0)