Skip to content

Commit

Permalink
Rollup merge of rust-lang#118135 - ouz-a:fix_stable_span, r=celinval
Browse files Browse the repository at this point in the history
Remove quotation from filename in stable_mir

Previously we had quotation marks in filenames which is obviously wrong this fixes that.

r? `@celinval`
  • Loading branch information
matthiaskrgr authored Nov 21, 2023
2 parents 2c85424 + 0b25415 commit a687126
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 10 deletions.
16 changes: 7 additions & 9 deletions compiler/rustc_smir/src/rustc_smir/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -72,15 +72,13 @@ impl<'tcx> Context for TablesWrapper<'tcx> {

fn get_filename(&self, span: &Span) -> Filename {
let tables = self.0.borrow();
opaque(
&tables
.tcx
.sess
.source_map()
.span_to_filename(tables[*span])
.display(rustc_span::FileNameDisplayPreference::Local)
.to_string(),
)
tables
.tcx
.sess
.source_map()
.span_to_filename(tables[*span])
.display(rustc_span::FileNameDisplayPreference::Local)
.to_string()
}

fn get_lines(&self, span: &Span) -> LineInfo {
Expand Down
2 changes: 1 addition & 1 deletion compiler/stable_mir/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,7 @@ pub enum ItemKind {
Const,
}

pub type Filename = Opaque;
pub type Filename = String;

/// Holds information about an item in the crate.
#[derive(Copy, Clone, PartialEq, Eq, Debug)]
Expand Down

0 comments on commit a687126

Please sign in to comment.