Skip to content

Commit 84c2fd8

Browse files
committed
Regression test for issue 24687.
1 parent ecd3572 commit 84c2fd8

File tree

3 files changed

+78
-0
lines changed

3 files changed

+78
-0
lines changed

src/test/auxiliary/issue24687_lib.rs

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
// Copyright 2015 The Rust Project Developers. See the COPYRIGHT
2+
// file at the top-level directory of this distribution and at
3+
// http://rust-lang.org/COPYRIGHT.
4+
//
5+
// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
6+
// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
7+
// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
8+
// option. This file may not be copied, modified, or distributed
9+
// except according to those terms.
10+
11+
#![crate_type="lib"]
12+
13+
// This is a file that pulls in a separate file as a submodule, where
14+
// that separate file has many multi-byte characters, to try to
15+
// encourage the compiler to trip on them.
16+
17+
mod issue24687_mbcs_in_comments;
18+
19+
pub use issue24687_mbcs_in_comments::D;
20+
Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
// Copyright 2015 The Rust Project Developers. See the COPYRIGHT
2+
// file at the top-level directory of this distribution and at
3+
// http://rust-lang.org/COPYRIGHT.
4+
//
5+
// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
6+
// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
7+
// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
8+
// option. This file may not be copied, modified, or distributed
9+
// except according to those terms.
10+
11+
use std::fmt;
12+
13+
// This ia file with many multi-byte characters, to try to encourage
14+
// the compiler to trip on them. The Drop implementation below will
15+
// need to have its source location embedded into the debug info for
16+
// the output file.
17+
18+
//                                                                       
19+
//                                                                       
20+
//                                                                       
21+
//                                                                       
22+
//                                                                       
23+
24+
//                                                                       
25+
//                                                                       
26+
//                                                                       
27+
//                                                                       
28+
//                                                                       
29+
30+
pub struct D<X:fmt::Debug>(pub X);
31+
32+
impl<X:fmt::Debug> Drop for D<X> {
33+
fn drop(&mut self) {
34+
//                                                             
35+
println!("Dropping D({:?})", self.0);
36+
}
37+
}
Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
// Copyright 2015 The Rust Project Developers. See the COPYRIGHT
2+
// file at the top-level directory of this distribution and at
3+
// http://rust-lang.org/COPYRIGHT.
4+
//
5+
// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
6+
// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
7+
// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
8+
// option. This file may not be copied, modified, or distributed
9+
// except according to those terms.
10+
11+
// aux-build:issue24687_lib.rs
12+
13+
extern crate issue24687_lib as d;
14+
15+
fn main() {
16+
// Create a d, which has a destructor whose body will be trans'ed
17+
// into the generated code here, and thus the local debuginfo will
18+
// need references into the original source locations from
19+
// `importer` above.
20+
let _d = d::D("Hi");
21+
}

0 commit comments

Comments
 (0)