microsoft/qdk

Public

mirrored from https://github.com/microsoft/qdkAvailable

CodeCommitsIssuesPull requestsActionsInsightsSecurity
v1.2.0

Branches

Tags

  • No tags available.
0Branches0Tags
Go to file
Add file
Code

Clone

HTTPS

Download ZIP

compiler/qsc_eval/src/error.rs

19lines · modepreview

// Copyright (c) Microsoft Corporation.
// Licensed under the MIT License.

use miette::SourceSpan;
use qsc_data_structures::span::Span;
use qsc_hir::hir::PackageId;
use std::fmt::Debug;

#[derive(Clone, Copy, Debug)]
pub struct PackageSpan {
    pub package: PackageId,
    pub span: Span,
}

impl From<PackageSpan> for SourceSpan {
    fn from(value: PackageSpan) -> Self {
        Self::from((value.span.lo as usize)..(value.span.hi as usize))
    }
}