forked from rust-lang/rust
-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix OOM when
ty::Instance
is used in query description
- Loading branch information
Lukas Markeffsky
committed
Jan 5, 2024
1 parent
11035f9
commit 2746748
Showing
4 changed files
with
45 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
12 changes: 12 additions & 0 deletions
12
tests/ui/resolve/auxiliary/suggest-constructor-cycle-error.rs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
mod m { | ||
pub struct Uuid(()); | ||
|
||
impl Uuid { | ||
pub fn encode_buffer() -> [u8; LENGTH] { | ||
[] | ||
} | ||
} | ||
const LENGTH: usize = 0; | ||
} | ||
|
||
pub use m::Uuid; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
// aux-build:suggest-constructor-cycle-error.rs | ||
//~^ cycle detected when getting the resolver for lowering [E0391] | ||
|
||
// Regression test for https://github.com/rust-lang/rust/issues/119625 | ||
|
||
extern crate suggest_constructor_cycle_error as a; | ||
|
||
const CONST_NAME: a::Uuid = a::Uuid(()); | ||
|
||
fn main() {} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
error[E0391]: cycle detected when getting the resolver for lowering | ||
| | ||
= note: ...which requires normalizing `[u8; suggest_constructor_cycle_error::::m::{impl#0}::encode_buffer::{constant#0}]`... | ||
note: ...which requires resolving instance `suggest_constructor_cycle_error::m::Uuid::encode_buffer::{constant#0}`... | ||
--> $DIR/auxiliary/suggest-constructor-cycle-error.rs:5:40 | ||
| | ||
LL | pub fn encode_buffer() -> [u8; LENGTH] { | ||
| ^^^^^^ | ||
= note: ...which requires calculating the lang items map... | ||
= note: ...which again requires getting the resolver for lowering, completing the cycle | ||
= note: see https://rustc-dev-guide.rust-lang.org/overview.html#queries and https://rustc-dev-guide.rust-lang.org/query.html for more information | ||
|
||
error: aborting due to 1 previous error | ||
|
||
For more information about this error, try `rustc --explain E0391`. |