Skip to content

Commit fbfa93d

Browse files
committed
Allow file names to end with '>'
The `rustc_span::FileName` enum already differentiates between real files and "fake" files such as `<anon>`. We do not need to artificially forbid real file names from ending in `>`.
1 parent a6dfd89 commit fbfa93d

File tree

5 files changed

+11
-1
lines changed

5 files changed

+11
-1
lines changed

compiler/rustc_span/src/lib.rs

-1
Original file line numberDiff line numberDiff line change
@@ -305,7 +305,6 @@ pub enum FileName {
305305

306306
impl From<PathBuf> for FileName {
307307
fn from(p: PathBuf) -> Self {
308-
assert!(!p.to_string_lossy().ends_with('>'));
309308
FileName::Real(RealFileName::LocalPath(p))
310309
}
311310
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
// run-pass
2+
// check-run-results
3+
4+
fn main() {
5+
println!(include!("silly-file-names/<leading-lt"));
6+
println!(include!("silly-file-names/trailing-gt>"));
7+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
comes from a file with a name that begins with '<'
2+
comes from a file with a name that ends with '>'
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
"comes from a file with a name that begins with '<'"
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
"comes from a file with a name that ends with '>'"

0 commit comments

Comments
 (0)