File tree 4 files changed +31
-6
lines changed
test/run-make/symbols-include-type-name
4 files changed +31
-6
lines changed Original file line number Diff line number Diff line change @@ -122,7 +122,7 @@ impl<'ast> Visitor<'ast> for NodeCollector<'ast> {
122
122
// Pick the def data. This need not be unique, but the more
123
123
// information we encapsulate into
124
124
let def_data = match i. node {
125
- ItemDefaultImpl ( ..) | ItemImpl ( ..) => DefPathData :: Impl ,
125
+ ItemDefaultImpl ( ..) | ItemImpl ( ..) => DefPathData :: Impl ( i . name ) ,
126
126
ItemEnum ( ..) | ItemStruct ( ..) | ItemTrait ( ..) => DefPathData :: Type ( i. name ) ,
127
127
ItemExternCrate ( ..) | ItemMod ( ..) => DefPathData :: Mod ( i. name ) ,
128
128
ItemStatic ( ..) | ItemConst ( ..) | ItemFn ( ..) => DefPathData :: Value ( i. name ) ,
Original file line number Diff line number Diff line change @@ -73,7 +73,7 @@ pub enum DefPathData {
73
73
Misc ,
74
74
75
75
// Different kinds of items and item-like things:
76
- Impl ,
76
+ Impl ( ast :: Name ) ,
77
77
Type ( ast:: Name ) ,
78
78
Mod ( ast:: Name ) ,
79
79
Value ( ast:: Name ) ,
@@ -177,6 +177,7 @@ impl DefPathData {
177
177
pub fn as_interned_str ( & self ) -> InternedString {
178
178
use self :: DefPathData :: * ;
179
179
match * self {
180
+ Impl ( name) |
180
181
Type ( name) |
181
182
Mod ( name) |
182
183
Value ( name) |
@@ -212,10 +213,6 @@ impl DefPathData {
212
213
InternedString :: new ( "?" )
213
214
}
214
215
215
- Impl => {
216
- InternedString :: new ( "<impl>" )
217
- }
218
-
219
216
ClosureExpr => {
220
217
InternedString :: new ( "<closure>" )
221
218
}
Original file line number Diff line number Diff line change
1
+ -include ../tools.mk
2
+
3
+ # Check that symbol names for methods include type names, instead of <impl>.
4
+
5
+ OUT =$(TMPDIR ) /lib.s
6
+
7
+ all :
8
+ $(RUSTC ) --crate-type staticlib --emit asm lib.rs
9
+ grep Def $(OUT )
Original file line number Diff line number Diff line change
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
+ pub struct Def {
12
+ pub id : i32 ,
13
+ }
14
+
15
+ impl Def {
16
+ pub fn new ( id : i32 ) -> Def {
17
+ Def { id : id }
18
+ }
19
+ }
You can’t perform that action at this time.
0 commit comments