Skip to content

defer reasoning about region relationships until after regionck #3238

Closed
@nikomatsakis

Description

@nikomatsakis

Right now, if you try to relate two regions, you either get back an immediate error or---more likely---you generate a constraint that will later be processed by region inference. In the former case, the error message is generally clearler: this is because the error is reported by the code that is relating the regions, and it can say something more specific about why the relation came about. In the latter case, the inferencer is reporting the error, and all it really knows is something like "due to the code at this span, r1 should be a subregion of r2". So the message is correspondingly vague.

Instead of merely passing in a span to the inferencer, we should pass in something like ty::type_err(). Then the region inferencer could use this to report a more intelligent message about why the constraint which could not be satisfied came about. This would also mean that you get more consistent errors.

Metadata

Metadata

Assignees

Labels

A-diagnosticsArea: Messages for errors, warnings, and lintsA-type-systemArea: Type systemC-enhancementCategory: An issue proposing an enhancement or a PR with one.

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions