Stabilize `FnOnce::Output` + Fix rebase
This commit is contained in:
parent
390b639e59
commit
d27e55c5d8
|
@ -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.
|
||||
|
|
|
@ -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.
|
||||
|
@ -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
|
||||
}
|
||||
|
|
|
@ -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)]
|
||||
|
||||
|
|
|
@ -18,7 +18,6 @@
|
|||
|
||||
// revisions: ok oneuse transmute krisskross
|
||||
|
||||
#![feature(fn_traits)]
|
||||
#![allow(dead_code, unused_variables)]
|
||||
|
||||
use std::marker::PhantomData;
|
||||
|
|
|
@ -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>);
|
||||
|
||||
|
|
Loading…
Reference in New Issue