Skip to content

Regression: overflow while adding drop-check rules #29844

Closed
@Manishearth

Description

@Manishearth

https://users.rust-lang.org/t/drop-check-regression-overflow-while-adding-drop-check-rules-for-struct/3617

use std::sync::Arc;

pub struct DescriptorSet<'a> {
    pub slots: Vec<AttachInfo<'a, Resources>>
}

pub trait ResourcesTrait<'r>: Sized {
    type DescriptorSet: 'r;
}

pub struct Resources;

impl<'a> ResourcesTrait<'a> for Resources {
    type DescriptorSet = DescriptorSet<'a>;
}

pub enum AttachInfo<'a, R: ResourcesTrait<'a>> {
    NextDescriptorSet(Arc<R::DescriptorSet>)
}

fn main() {
    let _x = DescriptorSet {slots: Vec::new()};
}

playpen

gives the error



<anon>:22:9: 22:11 error: overflow while adding drop-check rules for DescriptorSet<'_> [E0320]
<anon>:22     let _x = DescriptorSet {slots: Vec::new()};
                  ^~
<anon>:22:9: 22:11 note: overflowed on enum AttachInfo variant NextDescriptorSet field #0 type: alloc::arc::Arc<DescriptorSet<'_>>
<anon>:22     let _x = DescriptorSet {slots: Vec::new()};
                  ^~
<anon>:22:14: 22:47 error: overflow while adding drop-check rules for DescriptorSet<'_> [E0320]
<anon>:22     let _x = DescriptorSet {slots: Vec::new()};
                       ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
<anon>:22:14: 22:47 note: overflowed on enum AttachInfo variant NextDescriptorSet field #0 type: alloc::arc::Arc<DescriptorSet<'_>>
<anon>:22     let _x = DescriptorSet {slots: Vec::new()};
                       ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
<anon>:22:36: 22:46 error: overflow while adding drop-check rules for collections::vec::Vec<AttachInfo<'_, Resources>> [E0320]
<anon>:22     let _x = DescriptorSet {slots: Vec::new()};
                                             ^~~~~~~~~~
<anon>:22:36: 22:46 note: overflowed on struct alloc::arc::Arc field `_ptr` type: core::ptr::Shared<alloc::arc::ArcInner<DescriptorSet<'_>>>
<anon>:22     let _x = DescriptorSet {slots: Vec::new()};
                                             ^~~~~~~~~~
error: aborting due to 3 previous error

cc @pnkfelix

Metadata

Metadata

Assignees

Labels

T-compilerRelevant to the compiler team, which will review and decide on the PR/issue.regression-from-stable-to-stablePerformance or correctness regression from one stable version to another.

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions