@@ -1692,9 +1692,9 @@ pub fn build_return_block<'blk, 'tcx>(fcx: &FunctionContext<'blk, 'tcx>,
1692
1692
}
1693
1693
}
1694
1694
1695
- // trans_closure: Builds an LLVM function out of a source function.
1696
- // If the function closes over its environment a closure will be
1697
- // returned.
1695
+ /// Builds an LLVM function out of a source function.
1696
+ ///
1697
+ /// If the function closes over its environment a closure will be returned.
1698
1698
pub fn trans_closure < ' a , ' b , ' tcx > ( ccx : & CrateContext < ' a , ' tcx > ,
1699
1699
decl : & ast:: FnDecl ,
1700
1700
body : & ast:: Block ,
@@ -1827,8 +1827,7 @@ pub fn trans_closure<'a, 'b, 'tcx>(ccx: &CrateContext<'a, 'tcx>,
1827
1827
finish_fn ( & fcx, bcx, output_type, ret_debug_loc) ;
1828
1828
}
1829
1829
1830
- // trans_fn: creates an LLVM function corresponding to a source language
1831
- // function.
1830
+ /// Creates an LLVM function corresponding to a source language function.
1832
1831
pub fn trans_fn < ' a , ' tcx > ( ccx : & CrateContext < ' a , ' tcx > ,
1833
1832
decl : & ast:: FnDecl ,
1834
1833
body : & ast:: Block ,
@@ -2645,10 +2644,9 @@ fn exported_name<'a, 'tcx>(ccx: &CrateContext<'a, 'tcx>, id: ast::NodeId,
2645
2644
None => { }
2646
2645
}
2647
2646
2648
- match attr:: first_attr_value_str_by_name ( attrs , "export_name" ) {
2647
+ match attr:: find_export_name_attr ( ccx . sess ( ) . diagnostic ( ) , attrs ) {
2649
2648
// Use provided name
2650
2649
Some ( name) => name. to_string ( ) ,
2651
-
2652
2650
_ => ccx. tcx ( ) . map . with_path ( id, |path| {
2653
2651
if attr:: contains_name ( attrs, "no_mangle" ) {
2654
2652
// Don't mangle
0 commit comments