Skip to content

Commit

Permalink
Change rustc::util::common::FN_OUTPUT_NAME to a Symbol.
Browse files Browse the repository at this point in the history
  • Loading branch information
nnethercote committed May 17, 2019
1 parent c2e49bf commit be3724f
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 4 deletions.
4 changes: 2 additions & 2 deletions src/librustc/hir/lowering.rs
Expand Up @@ -2218,7 +2218,7 @@ impl<'a> LoweringContext<'a> {
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()))
Expand Down Expand Up @@ -2543,7 +2543,7 @@ impl<'a> LoweringContext<'a> {
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,
Expand Down
2 changes: 1 addition & 1 deletion src/librustc/traits/project.rs
Expand Up @@ -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
}
Expand Down
3 changes: 2 additions & 1 deletion src/librustc/util/common.rs
Expand Up @@ -11,14 +11,15 @@ use std::time::{Duration, Instant};

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};
use lazy_static;
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.
Expand Down
1 change: 1 addition & 0 deletions src/libsyntax_pos/symbol.rs
Expand Up @@ -385,6 +385,7 @@ symbols! {
option,
Option,
opt_out_copy,
Output,
overlapping_marker_traits,
packed,
panic_handler,
Expand Down

0 comments on commit be3724f

Please sign in to comment.