Skip to content

Commit

Permalink
Stabilize FnOnce::Output + Fix rebase
Browse files Browse the repository at this point in the history
  • Loading branch information
petrochenkov committed Jul 8, 2016
1 parent 390b639 commit d27e55c
Show file tree
Hide file tree
Showing 5 changed files with 3 additions and 8 deletions.
2 changes: 1 addition & 1 deletion src/libcore/ops.rs
Expand Up @@ -1929,7 +1929,7 @@ pub trait FnMut<Args> : FnOnce<Args> {
#[fundamental] // so that regex can rely that `&str: !FnMut`
pub trait FnOnce<Args> {
/// The returned type after the call operator is used.
#[unstable(feature = "fn_traits", issue = "29625")]
#[stable(feature = "fn_once_output", since = "1.12.0")]
type Output;

/// This is called when the call operator is used.
Expand Down
5 changes: 2 additions & 3 deletions src/librustc_resolve/lib.rs
Expand Up @@ -2287,7 +2287,7 @@ impl<'a> Resolver<'a> {
.and_then(|resolution| {
let always_binding = !pat_src.is_refutable() || opt_pat.is_some() ||
bmode != BindingMode::ByValue(Mutability::Immutable);
match def {
match resolution.base_def {
Def::Struct(..) | Def::Variant(..) |
Def::Const(..) | Def::AssociatedConst(..) if !always_binding => {
// A constant, unit variant, etc pattern.
Expand All @@ -2296,12 +2296,11 @@ impl<'a> Resolver<'a> {
Def::Struct(..) | Def::Variant(..) |
Def::Const(..) | Def::AssociatedConst(..) | Def::Static(..) => {
// A fresh binding that shadows something unacceptable.
let kind_name = PathResolution::new(def).kind_name();
resolve_error(
self,
ident.span,
ResolutionError::BindingShadowsSomethingUnacceptable(
pat_src.descr(), kind_name, ident.node.name)
pat_src.descr(), resolution.kind_name(), ident.node.name)
);
None
}
Expand Down
Expand Up @@ -8,7 +8,6 @@
// option. This file may not be copied, modified, or distributed
// except according to those terms.

#![feature(fn_traits)]
#![feature(unboxed_closures)]
#![feature(rustc_attrs)]

Expand Down
Expand Up @@ -18,7 +18,6 @@

// revisions: ok oneuse transmute krisskross

#![feature(fn_traits)]
#![allow(dead_code, unused_variables)]

use std::marker::PhantomData;
Expand Down
2 changes: 0 additions & 2 deletions src/test/run-pass/issue-28550.rs
Expand Up @@ -8,8 +8,6 @@
// option. This file may not be copied, modified, or distributed
// except according to those terms.

#![feature(fn_traits)]

struct A<F: FnOnce()->T,T>(F::Output);
struct B<F: FnOnce()->T,T>(A<F,T>);

Expand Down

0 comments on commit d27e55c

Please sign in to comment.