]> git.lizzy.rs Git - rust.git/commitdiff
Change `rustc::util::common::FN_OUTPUT_NAME` to a `Symbol`.
authorNicholas Nethercote <nnethercote@mozilla.com>
Fri, 17 May 2019 05:21:31 +0000 (15:21 +1000)
committerNicholas Nethercote <nnethercote@mozilla.com>
Fri, 17 May 2019 10:04:20 +0000 (20:04 +1000)
src/librustc/hir/lowering.rs
src/librustc/traits/project.rs
src/librustc/util/common.rs
src/libsyntax_pos/symbol.rs

index 3a8b139236ccad97fde64828468dc593664217eb..08372207d9a7ad4cc4240b49d7310b80e7bcc935 100644 (file)
@@ -2218,7 +2218,7 @@ fn lower_parenthesized_parameter_data(
                         bindings: hir_vec![
                             hir::TypeBinding {
                                 hir_id: this.next_id(),
-                                ident: Ident::from_str(FN_OUTPUT_NAME),
+                                ident: Ident::with_empty_ctxt(FN_OUTPUT_NAME),
                                 ty: output
                                     .as_ref()
                                     .map(|ty| this.lower_ty(&ty, ImplTraitContext::disallowed()))
@@ -2543,7 +2543,7 @@ fn lower_async_fn_output_type_to_future_bound(
         let future_params = P(hir::GenericArgs {
             args: hir_vec![],
             bindings: hir_vec![hir::TypeBinding {
-                ident: Ident::from_str(FN_OUTPUT_NAME),
+                ident: Ident::with_empty_ctxt(FN_OUTPUT_NAME),
                 ty: output_ty,
                 hir_id: self.next_id(),
                 span,
index f05a19372918edd3e1b062d59fbefd20730af8d8..67e76f7625ceee237c6ef5f5018603365ad80f83 100644 (file)
@@ -1421,7 +1421,7 @@ fn confirm_callable_candidate<'cx, 'gcx, 'tcx>(
                 projection_ty: ty::ProjectionTy::from_ref_and_name(
                     tcx,
                     trait_ref,
-                    Ident::from_str(FN_OUTPUT_NAME),
+                    Ident::with_empty_ctxt(FN_OUTPUT_NAME),
                 ),
                 ty: ret_type
             }
index 26194176350ac2a177e36a8c61649675d2a5db38..67eaa19c080b5ec80d7976f2ca1ee2a2194f1081 100644 (file)
@@ -11,6 +11,7 @@
 
 use std::sync::mpsc::{Sender};
 use syntax_pos::{SpanData};
+use syntax::symbol::{Symbol, sym};
 use rustc_macros::HashStable;
 use crate::ty::TyCtxt;
 use crate::dep_graph::{DepNode};
@@ -18,7 +19,7 @@
 use crate::session::Session;
 
 // The name of the associated type for `Fn` return types
-pub const FN_OUTPUT_NAME: &str = "Output";
+pub const FN_OUTPUT_NAME: Symbol = sym::Output;
 
 // Useful type to use with `Result<>` indicate that an error has already
 // been reported to the user, so no need to continue checking.
index c2a18c9df83babe5bf0b3c78ad04cd3b8ce0006e..551ace3bdaf0bf270abb4f51698d56ab986a10ef 100644 (file)
         option,
         Option,
         opt_out_copy,
+        Output,
         overlapping_marker_traits,
         packed,
         panic_handler,