[[package]]
name = "parking_lot"
-version = "0.5.4"
+version = "0.5.5"
source = "registry+https://github.com/rust-lang/crates.io-index"
dependencies = [
"owning_ref 0.3.3 (registry+https://github.com/rust-lang/crates.io-index)",
- "parking_lot_core 0.2.13 (registry+https://github.com/rust-lang/crates.io-index)",
+ "parking_lot_core 0.2.14 (registry+https://github.com/rust-lang/crates.io-index)",
]
[[package]]
name = "parking_lot_core"
-version = "0.2.13"
+version = "0.2.14"
source = "registry+https://github.com/rust-lang/crates.io-index"
dependencies = [
"libc 0.2.40 (registry+https://github.com/rust-lang/crates.io-index)",
"cfg-if 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)",
"ena 0.9.2 (registry+https://github.com/rust-lang/crates.io-index)",
"log 0.4.1 (registry+https://github.com/rust-lang/crates.io-index)",
- "parking_lot 0.5.4 (registry+https://github.com/rust-lang/crates.io-index)",
- "parking_lot_core 0.2.13 (registry+https://github.com/rust-lang/crates.io-index)",
+ "parking_lot 0.5.5 (registry+https://github.com/rust-lang/crates.io-index)",
+ "parking_lot_core 0.2.14 (registry+https://github.com/rust-lang/crates.io-index)",
"rustc-ap-serialize 110.0.0 (registry+https://github.com/rust-lang/crates.io-index)",
"stable_deref_trait 1.0.0 (registry+https://github.com/rust-lang/crates.io-index)",
"term 0.4.6 (registry+https://github.com/rust-lang/crates.io-index)",
"cfg-if 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)",
"ena 0.9.2 (registry+https://github.com/rust-lang/crates.io-index)",
"log 0.4.1 (registry+https://github.com/rust-lang/crates.io-index)",
- "parking_lot 0.5.4 (registry+https://github.com/rust-lang/crates.io-index)",
- "parking_lot_core 0.2.13 (registry+https://github.com/rust-lang/crates.io-index)",
+ "parking_lot 0.5.5 (registry+https://github.com/rust-lang/crates.io-index)",
+ "parking_lot_core 0.2.14 (registry+https://github.com/rust-lang/crates.io-index)",
"rustc_cratesio_shim 0.0.0",
"serialize 0.0.0",
"stable_deref_trait 1.0.0 (registry+https://github.com/rust-lang/crates.io-index)",
"checksum openssl-sys 0.9.28 (registry+https://github.com/rust-lang/crates.io-index)" = "0bbd90640b148b46305c1691eed6039b5c8509bed16991e3562a01eeb76902a3"
"checksum ordermap 0.3.5 (registry+https://github.com/rust-lang/crates.io-index)" = "a86ed3f5f244b372d6b1a00b72ef7f8876d0bc6a78a4c9985c53614041512063"
"checksum owning_ref 0.3.3 (registry+https://github.com/rust-lang/crates.io-index)" = "cdf84f41639e037b484f93433aa3897863b561ed65c6e59c7073d7c561710f37"
-"checksum parking_lot 0.5.4 (registry+https://github.com/rust-lang/crates.io-index)" = "9fd9d732f2de194336fb02fe11f9eed13d9e76f13f4315b4d88a14ca411750cd"
-"checksum parking_lot_core 0.2.13 (registry+https://github.com/rust-lang/crates.io-index)" = "538ef00b7317875071d5e00f603f24d16f0b474c1a5fc0ccb8b454ca72eafa79"
+"checksum parking_lot 0.5.5 (registry+https://github.com/rust-lang/crates.io-index)" = "d4d05f1349491390b1730afba60bb20d55761bef489a954546b58b4b34e1e2ac"
+"checksum parking_lot_core 0.2.14 (registry+https://github.com/rust-lang/crates.io-index)" = "4db1a8ccf734a7bce794cc19b3df06ed87ab2f3907036b693c68f56b4d4537fa"
"checksum percent-encoding 1.0.1 (registry+https://github.com/rust-lang/crates.io-index)" = "31010dd2e1ac33d5b46a5b413495239882813e0369f8ed8a5e266f173602f831"
"checksum pest 1.0.6 (registry+https://github.com/rust-lang/crates.io-index)" = "0fce5d8b5cc33983fc74f78ad552b5522ab41442c4ca91606e4236eb4b5ceefc"
"checksum pest_derive 1.0.7 (registry+https://github.com/rust-lang/crates.io-index)" = "ab94faafeb93f4c5e3ce81ca0e5a779529a602ad5d09ae6d21996bfb8b6a52bf"
#[unstable(feature = "ptr_internals", issue = "0", reason = "use into_raw_non_null instead")]
#[inline]
+ #[doc(hidden)]
pub fn into_unique(b: Box<T>) -> Unique<T> {
let unique = b.0;
mem::forget(b);
type Output;
/// Performs the `+` operation.
+ #[must_use]
#[stable(feature = "rust1", since = "1.0.0")]
fn add(self, rhs: RHS) -> Self::Output;
}
type Output;
/// Performs the `-` operation.
+ #[must_use]
#[stable(feature = "rust1", since = "1.0.0")]
fn sub(self, rhs: RHS) -> Self::Output;
}
type Output;
/// Performs the `*` operation.
+ #[must_use]
#[stable(feature = "rust1", since = "1.0.0")]
fn mul(self, rhs: RHS) -> Self::Output;
}
type Output;
/// Performs the `/` operation.
+ #[must_use]
#[stable(feature = "rust1", since = "1.0.0")]
fn div(self, rhs: RHS) -> Self::Output;
}
type Output = Self;
/// Performs the `%` operation.
+ #[must_use]
#[stable(feature = "rust1", since = "1.0.0")]
fn rem(self, rhs: RHS) -> Self::Output;
}
type Output;
/// Performs the unary `-` operation.
+ #[must_use]
#[stable(feature = "rust1", since = "1.0.0")]
fn neg(self) -> Self::Output;
}
type Output;
/// Performs the unary `!` operation.
+ #[must_use]
#[stable(feature = "rust1", since = "1.0.0")]
fn not(self) -> Self::Output;
}
type Output;
/// Performs the `&` operation.
+ #[must_use]
#[stable(feature = "rust1", since = "1.0.0")]
fn bitand(self, rhs: RHS) -> Self::Output;
}
type Output;
/// Performs the `|` operation.
+ #[must_use]
#[stable(feature = "rust1", since = "1.0.0")]
fn bitor(self, rhs: RHS) -> Self::Output;
}
type Output;
/// Performs the `^` operation.
+ #[must_use]
#[stable(feature = "rust1", since = "1.0.0")]
fn bitxor(self, rhs: RHS) -> Self::Output;
}
type Output;
/// Performs the `<<` operation.
+ #[must_use]
#[stable(feature = "rust1", since = "1.0.0")]
fn shl(self, rhs: RHS) -> Self::Output;
}
type Output;
/// Performs the `>>` operation.
+ #[must_use]
#[stable(feature = "rust1", since = "1.0.0")]
fn shr(self, rhs: RHS) -> Self::Output;
}
type Target: ?Sized;
/// Dereferences the value.
+ #[must_use]
#[stable(feature = "rust1", since = "1.0.0")]
fn deref(&self) -> &Self::Target;
}
reason = "use NonNull instead and consider PhantomData<T> \
(if you also use #[may_dangle]), Send, and/or Sync")]
#[allow(deprecated)]
+#[doc(hidden)]
pub struct Unique<T: ?Sized> {
pointer: NonZero<*const T>,
// NOTE: this marker has no consequences for variance, but is necessary
/// `self` was generated from, if any.
#[unstable(feature = "proc_macro", issue = "38356")]
pub fn parent(&self) -> Option<Span> {
- self.0.ctxt().outer().expn_info().map(|i| Span(i.call_site))
+ self.0.parent().map(Span)
}
/// The span for the origin source code that `self` was generated from. If
ForeignMod,
Expression,
Statement,
+ Closure,
Other,
}
self.check_repr(item, target);
}
- /// Check if an `#[inline]` is applied to a function.
+ /// Check if an `#[inline]` is applied to a function or a closure.
fn check_inline(&self, attr: &hir::Attribute, span: &Span, target: Target) {
- if target != Target::Fn {
+ if target != Target::Fn && target != Target::Closure {
struct_span_err!(self.tcx.sess,
attr.span,
E0518,
- "attribute should be applied to function")
- .span_label(*span, "not a function")
+ "attribute should be applied to function or closure")
+ .span_label(*span, "not a function or closure")
.emit();
}
}
}
fn check_expr_attributes(&self, expr: &hir::Expr) {
+ let target = match expr.node {
+ hir::ExprClosure(..) => Target::Closure,
+ _ => Target::Expression,
+ };
for attr in expr.attrs.iter() {
if attr.check_name("inline") {
- self.check_inline(attr, &expr.span, Target::Expression);
+ self.check_inline(attr, &expr.span, target);
}
if attr.check_name("repr") {
self.emit_repr_error(
}
fn maybe_lint_bare_trait(&self, span: Span, id: NodeId, is_global: bool) {
- if self.sess.features_untracked().dyn_trait {
- self.sess.buffer_lint_with_diagnostic(
- builtin::BARE_TRAIT_OBJECT,
- id,
- span,
- "trait objects without an explicit `dyn` are deprecated",
- builtin::BuiltinLintDiagnostics::BareTraitObject(span, is_global),
- )
- }
+ self.sess.buffer_lint_with_diagnostic(
+ builtin::BARE_TRAIT_OBJECT,
+ id,
+ span,
+ "trait objects without an explicit `dyn` are deprecated",
+ builtin::BuiltinLintDiagnostics::BareTraitObject(span, is_global),
+ )
}
fn wrap_in_try_constructor(
#![feature(const_fn)]
#![feature(core_intrinsics)]
#![feature(drain_filter)]
-#![feature(dyn_trait)]
#![feature(entry_or_default)]
+#![cfg_attr(stage0, feature(dyn_trait))]
#![feature(from_ref)]
#![feature(fs_read_write)]
#![cfg_attr(windows, feature(libc))]
ArgKind::Arg(format!("{}", field.name), "_".to_string())
}).collect::<Vec<_>>())
}
+ hir::map::NodeStructCtor(ref variant_data) => {
+ (self.tcx.sess.codemap().def_span(self.tcx.hir.span(variant_data.id())),
+ variant_data.fields()
+ .iter().map(|_| ArgKind::Arg("_".to_owned(), "_".to_owned()))
+ .collect())
+ }
_ => panic!("non-FnLike node found: {:?}", node),
}
}
let def_id = def.def_id();
fn_warned = check_must_use(cx, def_id, s.span, "return value of ");
}
-
- if let hir::ExprBinary(bin_op, ..) = expr.node {
- match bin_op.node {
- // Hardcoding the comparison operators here seemed more
- // expedient than the refactoring that would be needed to
- // look up the `#[must_use]` attribute which does exist on
- // the comparison trait methods
- hir::BiEq | hir::BiLt | hir::BiLe | hir::BiNe | hir::BiGe | hir::BiGt => {
- let msg = "unused comparison which must be used";
- cx.span_lint(UNUSED_MUST_USE, expr.span, msg);
- op_warned = true;
- },
- _ => {},
- }
+ let must_use_op = match expr.node {
+ // Hardcoding operators here seemed more expedient than the
+ // refactoring that would be needed to look up the `#[must_use]`
+ // attribute which does exist on the comparison trait methods
+ hir::ExprBinary(bin_op, ..) => {
+ match bin_op.node {
+ hir::BiEq | hir::BiLt | hir::BiLe | hir::BiNe | hir::BiGe | hir::BiGt => {
+ Some("comparison")
+ },
+ hir::BiAdd | hir::BiSub | hir::BiDiv | hir::BiMul | hir::BiRem => {
+ Some("arithmetic operation")
+ },
+ hir::BiAnd | hir::BiOr => {
+ Some("logical operation")
+ },
+ hir::BiBitXor | hir::BiBitAnd | hir::BiBitOr | hir::BiShl | hir::BiShr => {
+ Some("bitwise operation")
+ },
+ }
+ },
+ hir::ExprUnary(..) => Some("unary operation"),
+ _ => None
+ };
+ if let Some(must_use_op) = must_use_op {
+ cx.span_lint(UNUSED_MUST_USE, expr.span,
+ &format!("unused {} which must be used", must_use_op));
+ op_warned = true;
}
}
-
if !(ty_warned || fn_warned || op_warned) {
cx.span_lint(UNUSED_RESULTS, s.span, "unused result");
}
use rustc::mir::{AssertMessage, BasicBlock, BorrowKind, Location, Place};
use rustc::mir::{Mir, Mutability, Operand, Projection, ProjectionElem, Rvalue};
use rustc::mir::{Field, Statement, StatementKind, Terminator, TerminatorKind};
-use rustc::mir::ClosureRegionRequirements;
+use rustc::mir::{ClosureRegionRequirements, Local};
use rustc_data_structures::control_flow_graph::dominators::Dominators;
use rustc_data_structures::fx::FxHashSet;
erased_drop_place_ty: ty::Ty<'gcx>,
span: Span,
) {
+ let gcx = self.tcx.global_tcx();
+ let drop_field = |
+ mir: &mut MirBorrowckCtxt<'cx, 'gcx, 'tcx>,
+ (index, field): (usize, ty::Ty<'gcx>),
+ | {
+ let field_ty = gcx.normalize_erasing_regions(mir.param_env, field);
+ let place = drop_place.clone().field(Field::new(index), field_ty);
+
+ mir.visit_terminator_drop(loc, term, flow_state, &place, field_ty, span);
+ };
+
match erased_drop_place_ty.sty {
// When a struct is being dropped, we need to check
// whether it has a destructor, if it does, then we can
// destructor but `bar` does not, we will only check for
// borrows of `x.foo` and not `x.bar`. See #47703.
ty::TyAdt(def, substs) if def.is_struct() && !def.has_dtor(self.tcx) => {
- for (index, field) in def.all_fields().enumerate() {
- let gcx = self.tcx.global_tcx();
- let field_ty = field.ty(gcx, substs);
- let field_ty = gcx.normalize_erasing_regions(self.param_env, field_ty);
- let place = drop_place.clone().field(Field::new(index), field_ty);
-
- self.visit_terminator_drop(loc, term, flow_state, &place, field_ty, span);
- }
+ def.all_fields()
+ .map(|field| field.ty(gcx, substs))
+ .enumerate()
+ .for_each(|field| drop_field(self, field));
+ }
+ // Same as above, but for tuples.
+ ty::TyTuple(tys) => {
+ tys.iter().cloned().enumerate()
+ .for_each(|field| drop_field(self, field));
+ }
+ // Closures and generators also have disjoint fields, but they are only
+ // directly accessed in the body of the closure/generator.
+ ty::TyClosure(def, substs)
+ | ty::TyGenerator(def, substs, ..)
+ if *drop_place == Place::Local(Local::new(1)) && !self.mir.upvar_decls.is_empty()
+ => {
+ substs.upvar_tys(def, self.tcx).enumerate()
+ .for_each(|field| drop_field(self, field));
}
_ => {
// We have now refined the type of the value being
// subfield; so check whether that field's type still
// "needs drop". If so, we assume that the destructor
// may access any data it likes (i.e., a Deep Write).
- let gcx = self.tcx.global_tcx();
if erased_drop_place_ty.needs_drop(gcx, self.param_env) {
self.access_place(
ContextKind::Drop.new(loc),
#![feature(const_fn)]
#![feature(core_intrinsics)]
#![feature(decl_macro)]
-#![feature(dyn_trait)]
+#![cfg_attr(stage0, feature(dyn_trait))]
#![feature(fs_read_write)]
#![feature(macro_vis_matcher)]
#![feature(exhaustive_patterns)]
use std::ffi::CString;
use std::ptr;
+use attributes;
use libc::c_uint;
use rustc::middle::allocator::AllocatorKind;
use rustc::ty::TyCtxt;
if tcx.sess.target.target.options.default_hidden_visibility {
llvm::LLVMRustSetVisibility(llfn, llvm::Visibility::Hidden);
}
+ if tcx.sess.target.target.options.requires_uwtable {
+ attributes::emit_uwtable(llfn, true);
+ }
let callee = CString::new(kind.fn_name(method.name)).unwrap();
let callee = llvm::LLVMRustGetOrInsertFunction(llmod,
}
fn finalize(&mut self) -> Command {
- self.cmd.arg("--threads");
+ // There have been reports in the wild (rustwasm/wasm-bindgen#119) of
+ // using threads causing weird hangs and bugs. Disable it entirely as
+ // this isn't yet the bottleneck of compilation at all anyway.
+ self.cmd.arg("--no-threads");
+
self.cmd.arg("-z").arg("stack-size=1048576");
// FIXME we probably shouldn't pass this but instead pass an explicit
#![allow(non_camel_case_types)]
+#![cfg_attr(stage0, feature(dyn_trait))]
+
#![feature(box_patterns)]
#![feature(box_syntax)]
#![feature(crate_visibility_modifier)]
#![feature(rustc_diagnostic_macros)]
#![feature(slice_patterns)]
#![feature(slice_sort_by_cached_key)]
-#![feature(dyn_trait)]
#![feature(never_type)]
#[macro_use] extern crate log;
window.rootPath = \"{root_path}\";\
window.currentCrate = \"{krate}\";\
</script>\
+ <script src=\"{root_path}aliases.js\"></script>\
<script src=\"{root_path}main{suffix}.js\"></script>\
<script defer src=\"{root_path}search-index.js\"></script>\
- <script defer src=\"{root_path}aliases.js\"></script>\
</body>\
</html>",
css_extension = if css_file_extension {
html_root_url = "https://doc.rust-lang.org/nightly/",
html_playground_url = "https://play.rust-lang.org/")]
+#![cfg_attr(stage0, feature(dyn_trait))]
+
#![feature(ascii_ctype)]
#![feature(rustc_private)]
#![feature(box_patterns)]
#![feature(test)]
#![feature(vec_remove_item)]
#![feature(entry_and_modify)]
-#![feature(dyn_trait)]
extern crate arena;
extern crate getopts;
// Future-proofing enums/structs with #[non_exhaustive] attribute (RFC 2008)
(active, non_exhaustive, "1.22.0", Some(44109), None),
- // Trait object syntax with `dyn` prefix
- (active, dyn_trait, "1.22.0", Some(44662), Some(Edition::Edition2018)),
-
// `crate` as visibility modifier, synonymous to `pub(crate)`
(active, crate_visibility_modifier, "1.23.0", Some(45388), Some(Edition::Edition2018)),
(accepted, cfg_target_feature, "1.27.0", Some(29717), None),
// Allows #[target_feature(...)]
(accepted, target_feature, "1.27.0", None, None),
+ // Trait object syntax with `dyn` prefix
+ (accepted, dyn_trait, "1.27.0", Some(44662), None),
);
// If you change this, please modify src/doc/unstable-book as well. You must
gate_feature_post!(&self, never_type, ty.span,
"The `!` type is experimental");
}
- ast::TyKind::TraitObject(_, ast::TraitObjectSyntax::Dyn) => {
- gate_feature_post!(&self, dyn_trait, ty.span,
- "`dyn Trait` syntax is unstable");
- }
_ => {}
}
visit::walk_ty(self, ty)
use serialize::{Encodable, Decodable, Encoder, Decoder};
use std::collections::HashMap;
+use rustc_data_structures::fx::FxHashSet;
use std::fmt;
/// A SyntaxContext represents a chain of macro expansions (represented by marks).
true
})
}
+
+ /// Computes a mark such that both input marks are descendants of (or equal to) the returned
+ /// mark. That is, the following holds:
+ ///
+ /// ```rust
+ /// let la = least_ancestor(a, b);
+ /// assert!(a.is_descendant_of(la))
+ /// assert!(b.is_descendant_of(la))
+ /// ```
+ pub fn least_ancestor(mut a: Mark, mut b: Mark) -> Mark {
+ HygieneData::with(|data| {
+ // Compute the path from a to the root
+ let mut a_path = FxHashSet::<Mark>();
+ while a != Mark::root() {
+ a_path.insert(a);
+ a = data.marks[a.0 as usize].parent;
+ }
+
+ // While the path from b to the root hasn't intersected, move up the tree
+ while !a_path.contains(&b) {
+ b = data.marks[b.0 as usize].parent;
+ }
+
+ b
+ })
+ }
}
pub struct HygieneData {
})
}
+ /// Pulls a single mark off of the syntax context. This effectively moves the
+ /// context up one macro definition level. That is, if we have a nested macro
+ /// definition as follows:
+ ///
+ /// ```rust
+ /// macro_rules! f {
+ /// macro_rules! g {
+ /// ...
+ /// }
+ /// }
+ /// ```
+ ///
+ /// and we have a SyntaxContext that is referring to something declared by an invocation
+ /// of g (call it g1), calling remove_mark will result in the SyntaxContext for the
+ /// invocation of f that created g1.
+ /// Returns the mark that was removed.
pub fn remove_mark(&mut self) -> Mark {
HygieneData::with(|data| {
let outer_mark = data.syntax_contexts[self.0 as usize].outer_mark;
self.ctxt().outer().expn_info().map(|info| info.call_site.source_callsite()).unwrap_or(self)
}
+ /// The `Span` for the tokens in the previous macro expansion from which `self` was generated,
+ /// if any
+ pub fn parent(self) -> Option<Span> {
+ self.ctxt().outer().expn_info().map(|i| i.call_site)
+ }
+
/// Return the source callee.
///
/// Returns None if the supplied span has no expansion trace,
#[inline]
fn f() {}
-#[inline] //~ ERROR: attribute should be applied to function
+#[inline] //~ ERROR: attribute should be applied to function or closure
struct S;
fn main() {}
//! A simple test for testing many permutations of allowedness of
//! impl Trait
-#![feature(dyn_trait)]
use std::fmt::Debug;
// Allowed
// except according to those terms.
fn main() {
- #[inline] struct Foo; //~ ERROR attribute should be applied to function
+ #[inline] struct Foo; //~ ERROR attribute should be applied to function or closure
#[repr(C)] fn foo() {} //~ ERROR attribute should be applied to struct, enum or union
}
#[inline]
let _a = 4;
- //~^^ ERROR attribute should be applied to function
+ //~^^ ERROR attribute should be applied to function or closure
#[inline(XYZ)]
let _b = 4;
- //~^^ ERROR attribute should be applied to function
+ //~^^ ERROR attribute should be applied to function or closure
#[repr(nothing)]
let _x = 0;
#[inline(ABC)]
foo();
- //~^^ ERROR attribute should be applied to function
+ //~^^ ERROR attribute should be applied to function or closure
let _z = #[repr] 1;
//~^ ERROR attribute should not be applied to an expression
// compile-flags: -Z borrowck=mir
#![allow(dead_code)]
-#![feature(dyn_trait)]
use std::fmt::Debug;
// option. This file may not be copied, modified, or distributed
// except according to those terms.
-#![feature(dyn_trait)]
#![allow(bare_trait_object)]
struct Foo;
// compile-pass
// failure-status: 1
-#![feature(dyn_trait)]
-
use std::error::Error;
use std::io;
// ignore-pretty `dyn ::foo` parses differently in the current edition
-#![feature(dyn_trait)]
-
use std::fmt::Display;
static BYTE: u8 = 33;
--- /dev/null
+// Copyright 2012 The Rust Project Developers. See the COPYRIGHT
+// file at the top-level directory of this distribution and at
+// http://rust-lang.org/COPYRIGHT.
+//
+// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
+// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
+// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
+// option. This file may not be copied, modified, or distributed
+// except according to those terms.
+
+#![feature(nll)]
+
+struct WithDrop;
+
+impl Drop for WithDrop {
+ fn drop(&mut self) {}
+}
+
+fn consume(x: (&mut (), WithDrop)) -> &mut () { x.0 }
+
+fn main() {}
--- /dev/null
+// Copyright 2018 The Rust Project Developers. See the COPYRIGHT
+// file at the top-level directory of this distribution and at
+// http://rust-lang.org/COPYRIGHT.
+//
+// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
+// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
+// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
+// option. This file may not be copied, modified, or distributed
+// except according to those terms.
+
+#![feature(stmt_expr_attributes)]
+
+pub fn main() {
+ let _x = #[inline(always)] || {};
+ let _y = #[inline(never)] || {};
+ let _z = #[inline] || {};
+}
--- /dev/null
+// Copyright 2012 The Rust Project Developers. See the COPYRIGHT
+// file at the top-level directory of this distribution and at
+// http://rust-lang.org/COPYRIGHT.
+//
+// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
+// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
+// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
+// option. This file may not be copied, modified, or distributed
+// except according to those terms.
+
+#![feature(nll)]
+
+struct WithDrop;
+
+impl Drop for WithDrop {
+ fn drop(&mut self) {}
+}
+
+fn reborrow_from_closure(r: &mut ()) -> &mut () {
+ let d = WithDrop;
+ (move || { d; &mut *r })()
+}
+
+fn main() {}
--- /dev/null
+// Copyright 2012 The Rust Project Developers. See the COPYRIGHT
+// file at the top-level directory of this distribution and at
+// http://rust-lang.org/COPYRIGHT.
+//
+// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
+// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
+// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
+// option. This file may not be copied, modified, or distributed
+// except according to those terms.
+
+#![feature(nll)]
+#![feature(generators, generator_trait)]
+
+struct WithDrop;
+
+impl Drop for WithDrop {
+ fn drop(&mut self) {}
+}
+
+fn reborrow_from_generator(r: &mut ()) {
+ let d = WithDrop;
+ move || { d; yield; &mut *r };
+}
+
+fn main() {}
// option. This file may not be copied, modified, or distributed
// except according to those terms.
-#![feature(dyn_trait)]
-
use std::error::Error;
fn main() -> Result<(), Box<dyn Error>> {
-error[E0518]: attribute should be applied to function
+error[E0518]: attribute should be applied to function or closure
--> $DIR/E0518.rs:11:1
|
LL | #[inline(always)] //~ ERROR: E0518
| ^^^^^^^^^^^^^^^^^
LL | struct Foo;
- | ----------- not a function
+ | ----------- not a function or closure
-error[E0518]: attribute should be applied to function
+error[E0518]: attribute should be applied to function or closure
--> $DIR/E0518.rs:14:1
|
LL | #[inline(never)] //~ ERROR: E0518
| ^^^^^^^^^^^^^^^^
LL | / impl Foo {
LL | | }
- | |_- not a function
+ | |_- not a function or closure
error: aborting due to 2 previous errors
+++ /dev/null
-// Copyright 2016 The Rust Project Developers. See the COPYRIGHT
-// file at the top-level directory of this distribution and at
-// http://rust-lang.org/COPYRIGHT.
-//
-// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
-// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
-// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
-// option. This file may not be copied, modified, or distributed
-// except according to those terms.
-
-trait Trait {}
-type A = Box<dyn Trait>; //~ ERROR `dyn Trait` syntax is unstable
-
-fn main() {}
+++ /dev/null
-error[E0658]: `dyn Trait` syntax is unstable (see issue #44662)
- --> $DIR/feature-gate-dyn-trait.rs:12:14
- |
-LL | type A = Box<dyn Trait>; //~ ERROR `dyn Trait` syntax is unstable
- | ^^^^^^^^^
- |
- = help: add #![feature(dyn_trait)] to the crate attributes to enable
-
-error: aborting due to previous error
-
-For more information about this error, try `rustc --explain E0658`.
#![inline = "2100"]
#[inline = "2100"]
-//~^ ERROR attribute should be applied to function
+//~^ ERROR attribute should be applied to function or closure
mod inline {
mod inner { #![inline="2100"] }
- //~^ ERROR attribute should be applied to function
+ //~^ ERROR attribute should be applied to function or closure
#[inline = "2100"] fn f() { }
#[inline = "2100"] struct S;
- //~^ ERROR attribute should be applied to function
+ //~^ ERROR attribute should be applied to function or closure
#[inline = "2100"] type T = S;
- //~^ ERROR attribute should be applied to function
+ //~^ ERROR attribute should be applied to function or closure
#[inline = "2100"] impl S { }
- //~^ ERROR attribute should be applied to function
+ //~^ ERROR attribute should be applied to function or closure
}
fn main() {}
-error[E0518]: attribute should be applied to function
+error[E0518]: attribute should be applied to function or closure
--> $DIR/issue-43106-gating-of-inline.rs:21:1
|
LL | #[inline = "2100"]
| ^^^^^^^^^^^^^^^^^^
-LL | //~^ ERROR attribute should be applied to function
+LL | //~^ ERROR attribute should be applied to function or closure
LL | / mod inline {
LL | | mod inner { #![inline="2100"] }
-LL | | //~^ ERROR attribute should be applied to function
+LL | | //~^ ERROR attribute should be applied to function or closure
LL | |
... |
-LL | | //~^ ERROR attribute should be applied to function
+LL | | //~^ ERROR attribute should be applied to function or closure
LL | | }
- | |_- not a function
+ | |_- not a function or closure
-error[E0518]: attribute should be applied to function
+error[E0518]: attribute should be applied to function or closure
--> $DIR/issue-43106-gating-of-inline.rs:24:17
|
LL | mod inner { #![inline="2100"] }
- | ------------^^^^^^^^^^^^^^^^^-- not a function
+ | ------------^^^^^^^^^^^^^^^^^-- not a function or closure
-error[E0518]: attribute should be applied to function
+error[E0518]: attribute should be applied to function or closure
--> $DIR/issue-43106-gating-of-inline.rs:29:5
|
LL | #[inline = "2100"] struct S;
- | ^^^^^^^^^^^^^^^^^^ --------- not a function
+ | ^^^^^^^^^^^^^^^^^^ --------- not a function or closure
-error[E0518]: attribute should be applied to function
+error[E0518]: attribute should be applied to function or closure
--> $DIR/issue-43106-gating-of-inline.rs:32:5
|
LL | #[inline = "2100"] type T = S;
- | ^^^^^^^^^^^^^^^^^^ ----------- not a function
+ | ^^^^^^^^^^^^^^^^^^ ----------- not a function or closure
-error[E0518]: attribute should be applied to function
+error[E0518]: attribute should be applied to function or closure
--> $DIR/issue-43106-gating-of-inline.rs:35:5
|
LL | #[inline = "2100"] impl S { }
- | ^^^^^^^^^^^^^^^^^^ ---------- not a function
+ | ^^^^^^^^^^^^^^^^^^ ---------- not a function or closure
error: aborting due to 5 previous errors
LL | yield();
| ------- possible yield occurs here
-error[E0597]: borrowed value does not live long enough
- --> $DIR/yield-while-iterating.rs:50:17
- |
-LL | let mut b = || {
- | _________________^
-LL | | for p in &mut x {
-LL | | yield p;
-LL | | }
-LL | | };
- | | ^
- | | |
- | |_____temporary value only lives until here
- | temporary value does not live long enough
-
error[E0502]: cannot borrow `x` as immutable because it is also borrowed as mutable
--> $DIR/yield-while-iterating.rs:67:20
|
LL | b.resume();
| - borrow later used here
-error[E0597]: borrowed value does not live long enough
- --> $DIR/yield-while-iterating.rs:62:17
- |
-LL | let mut b = || {
- | _________________^
-LL | | for p in &mut x {
-LL | | yield p;
-LL | | }
-LL | | };
- | | ^
- | | |
- | |_____temporary value only lives until here
- | temporary value does not live long enough
-
-error: aborting due to 4 previous errors
+error: aborting due to 2 previous errors
-Some errors occurred: E0502, E0597, E0626.
+Some errors occurred: E0502, E0626.
For more information about an error, try `rustc --explain E0502`.
// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
// option. This file may not be copied, modified, or distributed
// except according to those terms.
-#![feature(dyn_trait)]
-
use std::fmt::Debug;
use std::option;
error[E0667]: `impl Trait` is not allowed in path parameters
- --> $DIR/impl_trait_projections.rs:23:51
+ --> $DIR/impl_trait_projections.rs:21:51
|
LL | fn projection_is_disallowed(x: impl Iterator) -> <impl Iterator>::Item {
| ^^^^^^^^^^^^^
error[E0667]: `impl Trait` is not allowed in path parameters
- --> $DIR/impl_trait_projections.rs:30:9
+ --> $DIR/impl_trait_projections.rs:28:9
|
LL | -> <impl Iterator as Iterator>::Item
| ^^^^^^^^^^^^^
error[E0667]: `impl Trait` is not allowed in path parameters
- --> $DIR/impl_trait_projections.rs:37:27
+ --> $DIR/impl_trait_projections.rs:35:27
|
LL | -> <::std::ops::Range<impl Debug> as Iterator>::Item
| ^^^^^^^^^^
error[E0667]: `impl Trait` is not allowed in path parameters
- --> $DIR/impl_trait_projections.rs:44:29
+ --> $DIR/impl_trait_projections.rs:42:29
|
LL | -> <dyn Iterator<Item = impl Debug> as Iterator>::Item
| ^^^^^^^^^^
error[E0223]: ambiguous associated type
- --> $DIR/impl_trait_projections.rs:23:50
+ --> $DIR/impl_trait_projections.rs:21:50
|
LL | fn projection_is_disallowed(x: impl Iterator) -> <impl Iterator>::Item {
| ^^^^^^^^^^^^^^^^^^^^^ ambiguous associated type
warning: not reporting region error due to nll
- --> $DIR/dyn-trait.rs:33:16
+ --> $DIR/dyn-trait.rs:32:16
|
LL | static_val(x); //~ ERROR cannot infer
| ^
error: free region `'a` does not outlive free region `'static`
- --> $DIR/dyn-trait.rs:33:5
+ --> $DIR/dyn-trait.rs:32:5
|
LL | static_val(x); //~ ERROR cannot infer
| ^^^^^^^^^^^^^
#![allow(warnings)]
-#![feature(dyn_trait)]
#![feature(in_band_lifetimes)]
use std::fmt::Debug;
error[E0495]: cannot infer an appropriate lifetime due to conflicting requirements
- --> $DIR/dyn-trait.rs:33:16
+ --> $DIR/dyn-trait.rs:32:16
|
LL | static_val(x); //~ ERROR cannot infer
| ^
|
-note: first, the lifetime cannot outlive the lifetime 'a as defined on the function body at 32:1...
- --> $DIR/dyn-trait.rs:32:1
+note: first, the lifetime cannot outlive the lifetime 'a as defined on the function body at 31:1...
+ --> $DIR/dyn-trait.rs:31:1
|
LL | fn with_dyn_debug_static<'a>(x: Box<dyn Debug + 'a>) {
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
--- /dev/null
+// Copyright 2018 The Rust Project Developers. See the COPYRIGHT
+// file at the top-level directory of this distribution and at
+// http://rust-lang.org/COPYRIGHT.
+//
+// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
+// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
+// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
+// option. This file may not be copied, modified, or distributed
+// except according to those terms.
+
+// Issue #50124 - Test warning for unused operator expressions
+
+// compile-pass
+
+#![feature(fn_must_use)]
+#![warn(unused_must_use)]
+
+fn main() {
+ let val = 1;
+ let val_pointer = &val;
+
+// Comparison Operators
+ val == 1;
+ val < 1;
+ val <= 1;
+ val != 1;
+ val >= 1;
+ val > 1;
+
+// Arithmetic Operators
+ val + 2;
+ val - 2;
+ val / 2;
+ val * 2;
+ val % 2;
+
+// Logical Operators
+ true && true;
+ false || true;
+
+// Bitwise Operators
+ 5 ^ val;
+ 5 & val;
+ 5 | val;
+ 5 << val;
+ 5 >> val;
+
+// Unary Operators
+ !val;
+ -val;
+ *val_pointer;
+}
--- /dev/null
+warning: unused comparison which must be used
+ --> $DIR/must-use-ops.rs:23:5
+ |
+LL | val == 1;
+ | ^^^^^^^^
+ |
+note: lint level defined here
+ --> $DIR/must-use-ops.rs:16:9
+ |
+LL | #![warn(unused_must_use)]
+ | ^^^^^^^^^^^^^^^
+
+warning: unused comparison which must be used
+ --> $DIR/must-use-ops.rs:24:5
+ |
+LL | val < 1;
+ | ^^^^^^^
+
+warning: unused comparison which must be used
+ --> $DIR/must-use-ops.rs:25:5
+ |
+LL | val <= 1;
+ | ^^^^^^^^
+
+warning: unused comparison which must be used
+ --> $DIR/must-use-ops.rs:26:5
+ |
+LL | val != 1;
+ | ^^^^^^^^
+
+warning: unused comparison which must be used
+ --> $DIR/must-use-ops.rs:27:5
+ |
+LL | val >= 1;
+ | ^^^^^^^^
+
+warning: unused comparison which must be used
+ --> $DIR/must-use-ops.rs:28:5
+ |
+LL | val > 1;
+ | ^^^^^^^
+
+warning: unused arithmetic operation which must be used
+ --> $DIR/must-use-ops.rs:31:5
+ |
+LL | val + 2;
+ | ^^^^^^^
+
+warning: unused arithmetic operation which must be used
+ --> $DIR/must-use-ops.rs:32:5
+ |
+LL | val - 2;
+ | ^^^^^^^
+
+warning: unused arithmetic operation which must be used
+ --> $DIR/must-use-ops.rs:33:5
+ |
+LL | val / 2;
+ | ^^^^^^^
+
+warning: unused arithmetic operation which must be used
+ --> $DIR/must-use-ops.rs:34:5
+ |
+LL | val * 2;
+ | ^^^^^^^
+
+warning: unused arithmetic operation which must be used
+ --> $DIR/must-use-ops.rs:35:5
+ |
+LL | val % 2;
+ | ^^^^^^^
+
+warning: unused logical operation which must be used
+ --> $DIR/must-use-ops.rs:38:5
+ |
+LL | true && true;
+ | ^^^^^^^^^^^^
+
+warning: unused logical operation which must be used
+ --> $DIR/must-use-ops.rs:39:5
+ |
+LL | false || true;
+ | ^^^^^^^^^^^^^
+
+warning: unused bitwise operation which must be used
+ --> $DIR/must-use-ops.rs:42:5
+ |
+LL | 5 ^ val;
+ | ^^^^^^^
+
+warning: unused bitwise operation which must be used
+ --> $DIR/must-use-ops.rs:43:5
+ |
+LL | 5 & val;
+ | ^^^^^^^
+
+warning: unused bitwise operation which must be used
+ --> $DIR/must-use-ops.rs:44:5
+ |
+LL | 5 | val;
+ | ^^^^^^^
+
+warning: unused bitwise operation which must be used
+ --> $DIR/must-use-ops.rs:45:5
+ |
+LL | 5 << val;
+ | ^^^^^^^^
+
+warning: unused bitwise operation which must be used
+ --> $DIR/must-use-ops.rs:46:5
+ |
+LL | 5 >> val;
+ | ^^^^^^^^
+
+warning: unused unary operation which must be used
+ --> $DIR/must-use-ops.rs:49:5
+ |
+LL | !val;
+ | ^^^^
+
+warning: unused unary operation which must be used
+ --> $DIR/must-use-ops.rs:50:5
+ |
+LL | -val;
+ | ^^^^
+
+warning: unused unary operation which must be used
+ --> $DIR/must-use-ops.rs:51:5
+ |
+LL | *val_pointer;
+ | ^^^^^^^^^^^^
+
let _it = vec![1, 2, 3].into_iter().map(usize::checked_add);
//~^ ERROR function is expected to take
+
+ call(Foo);
+ //~^ ERROR function is expected to take
}
fn foo() {}
fn qux(x: usize, y: usize) {}
+
+fn call<F, R>(_: F) where F: FnOnce() -> R {}
+struct Foo(u8);
LL | let _it = vec![1, 2, 3].into_iter().map(usize::checked_add);
| ^^^ expected function that takes 1 argument
-error: aborting due to 12 previous errors
+error[E0593]: function is expected to take 0 arguments, but it takes 1 argument
+ --> $DIR/closure-arg-count.rs:43:5
+ |
+LL | call(Foo);
+ | ^^^^ expected function that takes 0 arguments
+...
+LL | struct Foo(u8);
+ | --------------- takes 1 argument
+ |
+note: required by `call`
+ --> $DIR/closure-arg-count.rs:50:1
+ |
+LL | fn call<F, R>(_: F) where F: FnOnce() -> R {}
+ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+
+error: aborting due to 13 previous errors
For more information about this error, try `rustc --explain E0593`.
// Iterator>::Item`, to be exact).
#![allow(warnings)]
-#![feature(dyn_trait)]
#![feature(rustc_attrs)]
trait Anything { }
warning: not reporting region error due to nll
- --> $DIR/projection-no-regions-closure.rs:36:31
+ --> $DIR/projection-no-regions-closure.rs:35:31
|
LL | with_signature(x, |mut y| Box::new(y.next()))
| ^^^^^^^^^^^^^^^^^^
warning: not reporting region error due to nll
- --> $DIR/projection-no-regions-closure.rs:54:31
+ --> $DIR/projection-no-regions-closure.rs:53:31
|
LL | with_signature(x, |mut y| Box::new(y.next()))
| ^^^^^^^^^^^^^^^^^^
note: External requirements
- --> $DIR/projection-no-regions-closure.rs:36:23
+ --> $DIR/projection-no-regions-closure.rs:35:23
|
LL | with_signature(x, |mut y| Box::new(y.next()))
| ^^^^^^^^^^^^^^^^^^^^^^^^^^
= note: where <T as std::iter::Iterator>::Item: '_#2r
error[E0309]: the associated type `<T as std::iter::Iterator>::Item` may not live long enough
- --> $DIR/projection-no-regions-closure.rs:36:23
+ --> $DIR/projection-no-regions-closure.rs:35:23
|
LL | with_signature(x, |mut y| Box::new(y.next()))
| ^^^^^^^^^^^^^^^^^^^^^^^^^^
= help: consider adding an explicit lifetime bound `<T as std::iter::Iterator>::Item: ReEarlyBound(0, 'a)`...
note: No external requirements
- --> $DIR/projection-no-regions-closure.rs:32:1
+ --> $DIR/projection-no-regions-closure.rs:31:1
|
LL | / fn no_region<'a, T>(x: Box<T>) -> Box<dyn Anything + 'a>
LL | | where
]
note: External requirements
- --> $DIR/projection-no-regions-closure.rs:46:23
+ --> $DIR/projection-no-regions-closure.rs:45:23
|
LL | with_signature(x, |mut y| Box::new(y.next()))
| ^^^^^^^^^^^^^^^^^^^^^^^^^^
= note: where <T as std::iter::Iterator>::Item: '_#2r
note: No external requirements
- --> $DIR/projection-no-regions-closure.rs:42:1
+ --> $DIR/projection-no-regions-closure.rs:41:1
|
LL | / fn correct_region<'a, T>(x: Box<T>) -> Box<dyn Anything + 'a>
LL | | where
]
note: External requirements
- --> $DIR/projection-no-regions-closure.rs:54:23
+ --> $DIR/projection-no-regions-closure.rs:53:23
|
LL | with_signature(x, |mut y| Box::new(y.next()))
| ^^^^^^^^^^^^^^^^^^^^^^^^^^
= note: where <T as std::iter::Iterator>::Item: '_#3r
error[E0309]: the associated type `<T as std::iter::Iterator>::Item` may not live long enough
- --> $DIR/projection-no-regions-closure.rs:54:23
+ --> $DIR/projection-no-regions-closure.rs:53:23
|
LL | with_signature(x, |mut y| Box::new(y.next()))
| ^^^^^^^^^^^^^^^^^^^^^^^^^^
= help: consider adding an explicit lifetime bound `<T as std::iter::Iterator>::Item: ReEarlyBound(0, 'a)`...
note: No external requirements
- --> $DIR/projection-no-regions-closure.rs:50:1
+ --> $DIR/projection-no-regions-closure.rs:49:1
|
LL | / fn wrong_region<'a, 'b, T>(x: Box<T>) -> Box<dyn Anything + 'a>
LL | | where
]
note: External requirements
- --> $DIR/projection-no-regions-closure.rs:65:23
+ --> $DIR/projection-no-regions-closure.rs:64:23
|
LL | with_signature(x, |mut y| Box::new(y.next()))
| ^^^^^^^^^^^^^^^^^^^^^^^^^^
= note: where <T as std::iter::Iterator>::Item: '_#3r
note: No external requirements
- --> $DIR/projection-no-regions-closure.rs:60:1
+ --> $DIR/projection-no-regions-closure.rs:59:1
|
LL | / fn outlives_region<'a, 'b, T>(x: Box<T>) -> Box<dyn Anything + 'a>
LL | | where
// compile-flags:-Zborrowck=mir -Zverbose
#![allow(warnings)]
-#![feature(dyn_trait)]
trait Anything { }
warning: not reporting region error due to nll
- --> $DIR/projection-no-regions-fn.rs:24:5
+ --> $DIR/projection-no-regions-fn.rs:23:5
|
LL | Box::new(x.next())
| ^^^^^^^^^^^^^^^^^^
warning: not reporting region error due to nll
- --> $DIR/projection-no-regions-fn.rs:40:5
+ --> $DIR/projection-no-regions-fn.rs:39:5
|
LL | Box::new(x.next())
| ^^^^^^^^^^^^^^^^^^
error[E0309]: the associated type `<T as std::iter::Iterator>::Item` may not live long enough
- --> $DIR/projection-no-regions-fn.rs:24:5
+ --> $DIR/projection-no-regions-fn.rs:23:5
|
LL | Box::new(x.next())
| ^^^^^^^^^^^^^^^^^^
= help: consider adding an explicit lifetime bound `<T as std::iter::Iterator>::Item: ReEarlyBound(0, 'a)`...
error[E0309]: the associated type `<T as std::iter::Iterator>::Item` may not live long enough
- --> $DIR/projection-no-regions-fn.rs:40:5
+ --> $DIR/projection-no-regions-fn.rs:39:5
|
LL | Box::new(x.next())
| ^^^^^^^^^^^^^^^^^^
// compile-flags:-Zborrowck=mir -Zverbose
#![allow(warnings)]
-#![feature(dyn_trait)]
#![feature(rustc_attrs)]
use std::cell::Cell;
warning: not reporting region error due to nll
- --> $DIR/projection-one-region-closure.rs:56:39
+ --> $DIR/projection-one-region-closure.rs:55:39
|
LL | with_signature(cell, t, |cell, t| require(cell, t));
| ^^^^^^^
warning: not reporting region error due to nll
- --> $DIR/projection-one-region-closure.rs:68:39
+ --> $DIR/projection-one-region-closure.rs:67:39
|
LL | with_signature(cell, t, |cell, t| require(cell, t));
| ^^^^^^^
warning: not reporting region error due to nll
- --> $DIR/projection-one-region-closure.rs:90:39
+ --> $DIR/projection-one-region-closure.rs:89:39
|
LL | with_signature(cell, t, |cell, t| require(cell, t));
| ^^^^^^^
note: External requirements
- --> $DIR/projection-one-region-closure.rs:56:29
+ --> $DIR/projection-one-region-closure.rs:55:29
|
LL | with_signature(cell, t, |cell, t| require(cell, t));
| ^^^^^^^^^^^^^^^^^^^^^^^^^^
= note: where '_#1r: '_#2r
error[E0309]: the parameter type `T` may not live long enough
- --> $DIR/projection-one-region-closure.rs:56:29
+ --> $DIR/projection-one-region-closure.rs:55:29
|
LL | with_signature(cell, t, |cell, t| require(cell, t));
| ^^^^^^^^^^^^^^^^^^^^^^^^^^
= help: consider adding an explicit lifetime bound `T: ReFree(DefId(0/0:8 ~ projection_one_region_closure[317d]::no_relationships_late[0]), BrNamed(crate0:DefIndex(1:16), 'a))`...
error: free region `ReEarlyBound(0, 'b)` does not outlive free region `ReFree(DefId(0/0:8 ~ projection_one_region_closure[317d]::no_relationships_late[0]), BrNamed(crate0:DefIndex(1:16), 'a))`
- --> $DIR/projection-one-region-closure.rs:56:20
+ --> $DIR/projection-one-region-closure.rs:55:20
|
LL | with_signature(cell, t, |cell, t| require(cell, t));
| ^^^^
note: No external requirements
- --> $DIR/projection-one-region-closure.rs:52:1
+ --> $DIR/projection-one-region-closure.rs:51:1
|
LL | / fn no_relationships_late<'a, 'b, T>(cell: Cell<&'a ()>, t: T)
LL | | where
]
note: External requirements
- --> $DIR/projection-one-region-closure.rs:68:29
+ --> $DIR/projection-one-region-closure.rs:67:29
|
LL | with_signature(cell, t, |cell, t| require(cell, t));
| ^^^^^^^^^^^^^^^^^^^^^^^^^^
= note: where '_#2r: '_#3r
error[E0309]: the parameter type `T` may not live long enough
- --> $DIR/projection-one-region-closure.rs:68:29
+ --> $DIR/projection-one-region-closure.rs:67:29
|
LL | with_signature(cell, t, |cell, t| require(cell, t));
| ^^^^^^^^^^^^^^^^^^^^^^^^^^
= help: consider adding an explicit lifetime bound `T: ReEarlyBound(0, 'a)`...
error: free region `ReEarlyBound(1, 'b)` does not outlive free region `ReEarlyBound(0, 'a)`
- --> $DIR/projection-one-region-closure.rs:68:20
+ --> $DIR/projection-one-region-closure.rs:67:20
|
LL | with_signature(cell, t, |cell, t| require(cell, t));
| ^^^^
note: No external requirements
- --> $DIR/projection-one-region-closure.rs:63:1
+ --> $DIR/projection-one-region-closure.rs:62:1
|
LL | / fn no_relationships_early<'a, 'b, T>(cell: Cell<&'a ()>, t: T)
LL | | where
]
note: External requirements
- --> $DIR/projection-one-region-closure.rs:90:29
+ --> $DIR/projection-one-region-closure.rs:89:29
|
LL | with_signature(cell, t, |cell, t| require(cell, t));
| ^^^^^^^^^^^^^^^^^^^^^^^^^^
= note: where '_#2r: '_#3r
error[E0309]: the parameter type `T` may not live long enough
- --> $DIR/projection-one-region-closure.rs:90:29
+ --> $DIR/projection-one-region-closure.rs:89:29
|
LL | with_signature(cell, t, |cell, t| require(cell, t));
| ^^^^^^^^^^^^^^^^^^^^^^^^^^
= help: consider adding an explicit lifetime bound `T: ReEarlyBound(0, 'a)`...
error: free region `ReEarlyBound(1, 'b)` does not outlive free region `ReEarlyBound(0, 'a)`
- --> $DIR/projection-one-region-closure.rs:90:20
+ --> $DIR/projection-one-region-closure.rs:89:20
|
LL | with_signature(cell, t, |cell, t| require(cell, t));
| ^^^^
note: No external requirements
- --> $DIR/projection-one-region-closure.rs:75:1
+ --> $DIR/projection-one-region-closure.rs:74:1
|
LL | / fn projection_outlives<'a, 'b, T>(cell: Cell<&'a ()>, t: T)
LL | | where
]
note: External requirements
- --> $DIR/projection-one-region-closure.rs:103:29
+ --> $DIR/projection-one-region-closure.rs:102:29
|
LL | with_signature(cell, t, |cell, t| require(cell, t));
| ^^^^^^^^^^^^^^^^^^^^^^^^^^
= note: where '_#2r: '_#3r
note: No external requirements
- --> $DIR/projection-one-region-closure.rs:97:1
+ --> $DIR/projection-one-region-closure.rs:96:1
|
LL | / fn elements_outlive<'a, 'b, T>(cell: Cell<&'a ()>, t: T)
LL | | where
// compile-flags:-Zborrowck=mir -Zverbose
#![allow(warnings)]
-#![feature(dyn_trait)]
#![feature(rustc_attrs)]
use std::cell::Cell;
warning: not reporting region error due to nll
- --> $DIR/projection-one-region-trait-bound-closure.rs:48:39
+ --> $DIR/projection-one-region-trait-bound-closure.rs:47:39
|
LL | with_signature(cell, t, |cell, t| require(cell, t));
| ^^^^^^^
warning: not reporting region error due to nll
- --> $DIR/projection-one-region-trait-bound-closure.rs:59:39
+ --> $DIR/projection-one-region-trait-bound-closure.rs:58:39
|
LL | with_signature(cell, t, |cell, t| require(cell, t));
| ^^^^^^^
warning: not reporting region error due to nll
- --> $DIR/projection-one-region-trait-bound-closure.rs:80:39
+ --> $DIR/projection-one-region-trait-bound-closure.rs:79:39
|
LL | with_signature(cell, t, |cell, t| require(cell, t));
| ^^^^^^^
note: External requirements
- --> $DIR/projection-one-region-trait-bound-closure.rs:48:29
+ --> $DIR/projection-one-region-trait-bound-closure.rs:47:29
|
LL | with_signature(cell, t, |cell, t| require(cell, t));
| ^^^^^^^^^^^^^^^^^^^^^^^^^^
= note: where '_#1r: '_#2r
error: free region `ReEarlyBound(0, 'b)` does not outlive free region `ReFree(DefId(0/0:8 ~ projection_one_region_trait_bound_closure[317d]::no_relationships_late[0]), BrNamed(crate0:DefIndex(1:16), 'a))`
- --> $DIR/projection-one-region-trait-bound-closure.rs:48:20
+ --> $DIR/projection-one-region-trait-bound-closure.rs:47:20
|
LL | with_signature(cell, t, |cell, t| require(cell, t));
| ^^^^
note: No external requirements
- --> $DIR/projection-one-region-trait-bound-closure.rs:44:1
+ --> $DIR/projection-one-region-trait-bound-closure.rs:43:1
|
LL | / fn no_relationships_late<'a, 'b, T>(cell: Cell<&'a ()>, t: T)
LL | | where
]
note: External requirements
- --> $DIR/projection-one-region-trait-bound-closure.rs:59:29
+ --> $DIR/projection-one-region-trait-bound-closure.rs:58:29
|
LL | with_signature(cell, t, |cell, t| require(cell, t));
| ^^^^^^^^^^^^^^^^^^^^^^^^^^
= note: where '_#2r: '_#3r
error: free region `ReEarlyBound(1, 'b)` does not outlive free region `ReEarlyBound(0, 'a)`
- --> $DIR/projection-one-region-trait-bound-closure.rs:59:20
+ --> $DIR/projection-one-region-trait-bound-closure.rs:58:20
|
LL | with_signature(cell, t, |cell, t| require(cell, t));
| ^^^^
note: No external requirements
- --> $DIR/projection-one-region-trait-bound-closure.rs:54:1
+ --> $DIR/projection-one-region-trait-bound-closure.rs:53:1
|
LL | / fn no_relationships_early<'a, 'b, T>(cell: Cell<&'a ()>, t: T)
LL | | where
]
note: External requirements
- --> $DIR/projection-one-region-trait-bound-closure.rs:80:29
+ --> $DIR/projection-one-region-trait-bound-closure.rs:79:29
|
LL | with_signature(cell, t, |cell, t| require(cell, t));
| ^^^^^^^^^^^^^^^^^^^^^^^^^^
= note: where '_#2r: '_#3r
error: free region `ReEarlyBound(1, 'b)` does not outlive free region `ReEarlyBound(0, 'a)`
- --> $DIR/projection-one-region-trait-bound-closure.rs:80:20
+ --> $DIR/projection-one-region-trait-bound-closure.rs:79:20
|
LL | with_signature(cell, t, |cell, t| require(cell, t));
| ^^^^
note: No external requirements
- --> $DIR/projection-one-region-trait-bound-closure.rs:65:1
+ --> $DIR/projection-one-region-trait-bound-closure.rs:64:1
|
LL | / fn projection_outlives<'a, 'b, T>(cell: Cell<&'a ()>, t: T)
LL | | where
]
note: External requirements
- --> $DIR/projection-one-region-trait-bound-closure.rs:91:29
+ --> $DIR/projection-one-region-trait-bound-closure.rs:90:29
|
LL | with_signature(cell, t, |cell, t| require(cell, t));
| ^^^^^^^^^^^^^^^^^^^^^^^^^^
= note: where '_#2r: '_#3r
note: No external requirements
- --> $DIR/projection-one-region-trait-bound-closure.rs:86:1
+ --> $DIR/projection-one-region-trait-bound-closure.rs:85:1
|
LL | / fn elements_outlive<'a, 'b, T>(cell: Cell<&'a ()>, t: T)
LL | | where
]
note: External requirements
- --> $DIR/projection-one-region-trait-bound-closure.rs:103:29
+ --> $DIR/projection-one-region-trait-bound-closure.rs:102:29
|
LL | with_signature(cell, t, |cell, t| require(cell, t));
| ^^^^^^^^^^^^^^^^^^^^^^^^^^
= note: where '_#1r: '_#2r
note: No external requirements
- --> $DIR/projection-one-region-trait-bound-closure.rs:95:1
+ --> $DIR/projection-one-region-trait-bound-closure.rs:94:1
|
LL | / fn one_region<'a, T>(cell: Cell<&'a ()>, t: T)
LL | | where
// compile-pass
#![allow(warnings)]
-#![feature(dyn_trait)]
#![feature(rustc_attrs)]
use std::cell::Cell;
note: No external requirements
- --> $DIR/projection-one-region-trait-bound-static-closure.rs:47:29
+ --> $DIR/projection-one-region-trait-bound-static-closure.rs:46:29
|
LL | with_signature(cell, t, |cell, t| require(cell, t));
| ^^^^^^^^^^^^^^^^^^^^^^^^^^
]
note: No external requirements
- --> $DIR/projection-one-region-trait-bound-static-closure.rs:43:1
+ --> $DIR/projection-one-region-trait-bound-static-closure.rs:42:1
|
LL | / fn no_relationships_late<'a, 'b, T>(cell: Cell<&'a ()>, t: T)
LL | | where
]
note: No external requirements
- --> $DIR/projection-one-region-trait-bound-static-closure.rs:56:29
+ --> $DIR/projection-one-region-trait-bound-static-closure.rs:55:29
|
LL | with_signature(cell, t, |cell, t| require(cell, t));
| ^^^^^^^^^^^^^^^^^^^^^^^^^^
]
note: No external requirements
- --> $DIR/projection-one-region-trait-bound-static-closure.rs:51:1
+ --> $DIR/projection-one-region-trait-bound-static-closure.rs:50:1
|
LL | / fn no_relationships_early<'a, 'b, T>(cell: Cell<&'a ()>, t: T)
LL | | where
]
note: No external requirements
- --> $DIR/projection-one-region-trait-bound-static-closure.rs:75:29
+ --> $DIR/projection-one-region-trait-bound-static-closure.rs:74:29
|
LL | with_signature(cell, t, |cell, t| require(cell, t));
| ^^^^^^^^^^^^^^^^^^^^^^^^^^
]
note: No external requirements
- --> $DIR/projection-one-region-trait-bound-static-closure.rs:60:1
+ --> $DIR/projection-one-region-trait-bound-static-closure.rs:59:1
|
LL | / fn projection_outlives<'a, 'b, T>(cell: Cell<&'a ()>, t: T)
LL | | where
]
note: No external requirements
- --> $DIR/projection-one-region-trait-bound-static-closure.rs:84:29
+ --> $DIR/projection-one-region-trait-bound-static-closure.rs:83:29
|
LL | with_signature(cell, t, |cell, t| require(cell, t));
| ^^^^^^^^^^^^^^^^^^^^^^^^^^
]
note: No external requirements
- --> $DIR/projection-one-region-trait-bound-static-closure.rs:79:1
+ --> $DIR/projection-one-region-trait-bound-static-closure.rs:78:1
|
LL | / fn elements_outlive<'a, 'b, T>(cell: Cell<&'a ()>, t: T)
LL | | where
]
note: No external requirements
- --> $DIR/projection-one-region-trait-bound-static-closure.rs:96:29
+ --> $DIR/projection-one-region-trait-bound-static-closure.rs:95:29
|
LL | with_signature(cell, t, |cell, t| require(cell, t));
| ^^^^^^^^^^^^^^^^^^^^^^^^^^
]
note: No external requirements
- --> $DIR/projection-one-region-trait-bound-static-closure.rs:88:1
+ --> $DIR/projection-one-region-trait-bound-static-closure.rs:87:1
|
LL | / fn one_region<'a, T>(cell: Cell<&'a ()>, t: T)
LL | | where
// compile-flags:-Zborrowck=mir -Zverbose
#![allow(warnings)]
-#![feature(dyn_trait)]
#![feature(rustc_attrs)]
use std::cell::Cell;
warning: not reporting region error due to nll
- --> $DIR/projection-two-region-trait-bound-closure.rs:49:39
+ --> $DIR/projection-two-region-trait-bound-closure.rs:48:39
|
LL | with_signature(cell, t, |cell, t| require(cell, t));
| ^^^^^^^
warning: not reporting region error due to nll
- --> $DIR/projection-two-region-trait-bound-closure.rs:60:39
+ --> $DIR/projection-two-region-trait-bound-closure.rs:59:39
|
LL | with_signature(cell, t, |cell, t| require(cell, t));
| ^^^^^^^
warning: not reporting region error due to nll
- --> $DIR/projection-two-region-trait-bound-closure.rs:81:39
+ --> $DIR/projection-two-region-trait-bound-closure.rs:80:39
|
LL | with_signature(cell, t, |cell, t| require(cell, t));
| ^^^^^^^
warning: not reporting region error due to nll
- --> $DIR/projection-two-region-trait-bound-closure.rs:109:39
+ --> $DIR/projection-two-region-trait-bound-closure.rs:108:39
|
LL | with_signature(cell, t, |cell, t| require(cell, t));
| ^^^^^^^
note: External requirements
- --> $DIR/projection-two-region-trait-bound-closure.rs:49:29
+ --> $DIR/projection-two-region-trait-bound-closure.rs:48:29
|
LL | with_signature(cell, t, |cell, t| require(cell, t));
| ^^^^^^^^^^^^^^^^^^^^^^^^^^
= note: where <T as Anything<ReClosureBound('_#1r), ReClosureBound('_#2r)>>::AssocType: '_#3r
error[E0309]: the associated type `<T as Anything<'_#5r, '_#6r>>::AssocType` may not live long enough
- --> $DIR/projection-two-region-trait-bound-closure.rs:49:29
+ --> $DIR/projection-two-region-trait-bound-closure.rs:48:29
|
LL | with_signature(cell, t, |cell, t| require(cell, t));
| ^^^^^^^^^^^^^^^^^^^^^^^^^^
= help: consider adding an explicit lifetime bound `<T as Anything<'_#5r, '_#6r>>::AssocType: ReFree(DefId(0/0:8 ~ projection_two_region_trait_bound_closure[317d]::no_relationships_late[0]), BrNamed(crate0:DefIndex(1:18), 'a))`...
note: No external requirements
- --> $DIR/projection-two-region-trait-bound-closure.rs:45:1
+ --> $DIR/projection-two-region-trait-bound-closure.rs:44:1
|
LL | / fn no_relationships_late<'a, 'b, 'c, T>(cell: Cell<&'a ()>, t: T)
LL | | where
]
note: External requirements
- --> $DIR/projection-two-region-trait-bound-closure.rs:60:29
+ --> $DIR/projection-two-region-trait-bound-closure.rs:59:29
|
LL | with_signature(cell, t, |cell, t| require(cell, t));
| ^^^^^^^^^^^^^^^^^^^^^^^^^^
= note: where <T as Anything<ReClosureBound('_#2r), ReClosureBound('_#3r)>>::AssocType: '_#4r
error[E0309]: the associated type `<T as Anything<'_#6r, '_#7r>>::AssocType` may not live long enough
- --> $DIR/projection-two-region-trait-bound-closure.rs:60:29
+ --> $DIR/projection-two-region-trait-bound-closure.rs:59:29
|
LL | with_signature(cell, t, |cell, t| require(cell, t));
| ^^^^^^^^^^^^^^^^^^^^^^^^^^
= help: consider adding an explicit lifetime bound `<T as Anything<'_#6r, '_#7r>>::AssocType: ReEarlyBound(0, 'a)`...
note: No external requirements
- --> $DIR/projection-two-region-trait-bound-closure.rs:55:1
+ --> $DIR/projection-two-region-trait-bound-closure.rs:54:1
|
LL | / fn no_relationships_early<'a, 'b, 'c, T>(cell: Cell<&'a ()>, t: T)
LL | | where
]
note: External requirements
- --> $DIR/projection-two-region-trait-bound-closure.rs:81:29
+ --> $DIR/projection-two-region-trait-bound-closure.rs:80:29
|
LL | with_signature(cell, t, |cell, t| require(cell, t));
| ^^^^^^^^^^^^^^^^^^^^^^^^^^
= note: where <T as Anything<ReClosureBound('_#2r), ReClosureBound('_#3r)>>::AssocType: '_#4r
error[E0309]: the associated type `<T as Anything<'_#6r, '_#7r>>::AssocType` may not live long enough
- --> $DIR/projection-two-region-trait-bound-closure.rs:81:29
+ --> $DIR/projection-two-region-trait-bound-closure.rs:80:29
|
LL | with_signature(cell, t, |cell, t| require(cell, t));
| ^^^^^^^^^^^^^^^^^^^^^^^^^^
= help: consider adding an explicit lifetime bound `<T as Anything<'_#6r, '_#7r>>::AssocType: ReEarlyBound(0, 'a)`...
note: No external requirements
- --> $DIR/projection-two-region-trait-bound-closure.rs:66:1
+ --> $DIR/projection-two-region-trait-bound-closure.rs:65:1
|
LL | / fn projection_outlives<'a, 'b, 'c, T>(cell: Cell<&'a ()>, t: T)
LL | | where
]
note: External requirements
- --> $DIR/projection-two-region-trait-bound-closure.rs:92:29
+ --> $DIR/projection-two-region-trait-bound-closure.rs:91:29
|
LL | with_signature(cell, t, |cell, t| require(cell, t));
| ^^^^^^^^^^^^^^^^^^^^^^^^^^
= note: where <T as Anything<ReClosureBound('_#2r), ReClosureBound('_#3r)>>::AssocType: '_#4r
note: No external requirements
- --> $DIR/projection-two-region-trait-bound-closure.rs:87:1
+ --> $DIR/projection-two-region-trait-bound-closure.rs:86:1
|
LL | / fn elements_outlive1<'a, 'b, 'c, T>(cell: Cell<&'a ()>, t: T)
LL | | where
]
note: External requirements
- --> $DIR/projection-two-region-trait-bound-closure.rs:101:29
+ --> $DIR/projection-two-region-trait-bound-closure.rs:100:29
|
LL | with_signature(cell, t, |cell, t| require(cell, t));
| ^^^^^^^^^^^^^^^^^^^^^^^^^^
= note: where <T as Anything<ReClosureBound('_#2r), ReClosureBound('_#3r)>>::AssocType: '_#4r
note: No external requirements
- --> $DIR/projection-two-region-trait-bound-closure.rs:96:1
+ --> $DIR/projection-two-region-trait-bound-closure.rs:95:1
|
LL | / fn elements_outlive2<'a, 'b, 'c, T>(cell: Cell<&'a ()>, t: T)
LL | | where
]
note: External requirements
- --> $DIR/projection-two-region-trait-bound-closure.rs:109:29
+ --> $DIR/projection-two-region-trait-bound-closure.rs:108:29
|
LL | with_signature(cell, t, |cell, t| require(cell, t));
| ^^^^^^^^^^^^^^^^^^^^^^^^^^
= note: where <T as Anything<ReClosureBound('_#1r), ReClosureBound('_#1r)>>::AssocType: '_#2r
error: free region `ReEarlyBound(0, 'b)` does not outlive free region `ReFree(DefId(0/0:13 ~ projection_two_region_trait_bound_closure[317d]::two_regions[0]), BrNamed(crate0:DefIndex(1:43), 'a))`
- --> $DIR/projection-two-region-trait-bound-closure.rs:109:20
+ --> $DIR/projection-two-region-trait-bound-closure.rs:108:20
|
LL | with_signature(cell, t, |cell, t| require(cell, t));
| ^^^^
note: No external requirements
- --> $DIR/projection-two-region-trait-bound-closure.rs:105:1
+ --> $DIR/projection-two-region-trait-bound-closure.rs:104:1
|
LL | / fn two_regions<'a, 'b, T>(cell: Cell<&'a ()>, t: T)
LL | | where
]
note: External requirements
- --> $DIR/projection-two-region-trait-bound-closure.rs:120:29
+ --> $DIR/projection-two-region-trait-bound-closure.rs:119:29
|
LL | with_signature(cell, t, |cell, t| require(cell, t));
| ^^^^^^^^^^^^^^^^^^^^^^^^^^
= note: where <T as Anything<ReClosureBound('_#2r), ReClosureBound('_#2r)>>::AssocType: '_#3r
note: No external requirements
- --> $DIR/projection-two-region-trait-bound-closure.rs:115:1
+ --> $DIR/projection-two-region-trait-bound-closure.rs:114:1
|
LL | / fn two_regions_outlive<'a, 'b, T>(cell: Cell<&'a ()>, t: T)
LL | | where
]
note: External requirements
- --> $DIR/projection-two-region-trait-bound-closure.rs:132:29
+ --> $DIR/projection-two-region-trait-bound-closure.rs:131:29
|
LL | with_signature(cell, t, |cell, t| require(cell, t));
| ^^^^^^^^^^^^^^^^^^^^^^^^^^
= note: where <T as Anything<ReClosureBound('_#1r), ReClosureBound('_#1r)>>::AssocType: '_#2r
note: No external requirements
- --> $DIR/projection-two-region-trait-bound-closure.rs:124:1
+ --> $DIR/projection-two-region-trait-bound-closure.rs:123:1
|
LL | / fn one_region<'a, T>(cell: Cell<&'a ()>, t: T)
LL | | where
// compile-flags:-Zborrowck=mir -Zverbose
#![allow(warnings)]
-#![feature(dyn_trait)]
#![feature(rustc_attrs)]
use std::cell::Cell;
warning: not reporting region error due to nll
- --> $DIR/ty-param-closure-approximate-lower-bound.rs:35:31
+ --> $DIR/ty-param-closure-approximate-lower-bound.rs:34:31
|
LL | twice(cell, value, |a, b| invoke(a, b));
| ^^^^^^^^^^^^
warning: not reporting region error due to nll
- --> $DIR/ty-param-closure-approximate-lower-bound.rs:43:31
+ --> $DIR/ty-param-closure-approximate-lower-bound.rs:42:31
|
LL | twice(cell, value, |a, b| invoke(a, b));
| ^^^^^^
warning: not reporting region error due to nll
- --> $DIR/ty-param-closure-approximate-lower-bound.rs:43:31
+ --> $DIR/ty-param-closure-approximate-lower-bound.rs:42:31
|
LL | twice(cell, value, |a, b| invoke(a, b));
| ^^^^^^^^^^^^
note: External requirements
- --> $DIR/ty-param-closure-approximate-lower-bound.rs:35:24
+ --> $DIR/ty-param-closure-approximate-lower-bound.rs:34:24
|
LL | twice(cell, value, |a, b| invoke(a, b));
| ^^^^^^^^^^^^^^^^^^^
= note: where T: '_#1r
note: No external requirements
- --> $DIR/ty-param-closure-approximate-lower-bound.rs:33:1
+ --> $DIR/ty-param-closure-approximate-lower-bound.rs:32:1
|
LL | / fn generic<T>(value: T) {
LL | | let cell = Cell::new(&());
]
note: External requirements
- --> $DIR/ty-param-closure-approximate-lower-bound.rs:43:24
+ --> $DIR/ty-param-closure-approximate-lower-bound.rs:42:24
|
LL | twice(cell, value, |a, b| invoke(a, b));
| ^^^^^^^^^^^^^^^^^^^
= note: where T: '_#1r
error[E0309]: the parameter type `T` may not live long enough
- --> $DIR/ty-param-closure-approximate-lower-bound.rs:43:24
+ --> $DIR/ty-param-closure-approximate-lower-bound.rs:42:24
|
LL | twice(cell, value, |a, b| invoke(a, b));
| ^^^^^^^^^^^^^^^^^^^
= help: consider adding an explicit lifetime bound `T: ReFree(DefId(0/0:6 ~ ty_param_closure_approximate_lower_bound[317d]::generic_fail[0]), BrNamed(crate0:DefIndex(1:15), 'a))`...
note: No external requirements
- --> $DIR/ty-param-closure-approximate-lower-bound.rs:42:1
+ --> $DIR/ty-param-closure-approximate-lower-bound.rs:41:1
|
LL | / fn generic_fail<'a, T>(cell: Cell<&'a ()>, value: T) {
LL | | twice(cell, value, |a, b| invoke(a, b));
// compile-flags:-Zborrowck=mir -Zverbose
#![allow(warnings)]
-#![feature(dyn_trait)]
#![feature(rustc_attrs)]
use std::fmt::Debug;
warning: not reporting region error due to nll
- --> $DIR/ty-param-closure-outlives-from-return-type.rs:37:27
+ --> $DIR/ty-param-closure-outlives-from-return-type.rs:36:27
|
LL | with_signature(x, |y| y)
| ^
warning: not reporting region error due to nll
- --> $DIR/ty-param-closure-outlives-from-return-type.rs:53:5
+ --> $DIR/ty-param-closure-outlives-from-return-type.rs:52:5
|
LL | x
| ^
note: External requirements
- --> $DIR/ty-param-closure-outlives-from-return-type.rs:37:23
+ --> $DIR/ty-param-closure-outlives-from-return-type.rs:36:23
|
LL | with_signature(x, |y| y)
| ^^^^^
= note: where T: '_#2r
error[E0309]: the parameter type `T` may not live long enough
- --> $DIR/ty-param-closure-outlives-from-return-type.rs:37:23
+ --> $DIR/ty-param-closure-outlives-from-return-type.rs:36:23
|
LL | with_signature(x, |y| y)
| ^^^^^
= help: consider adding an explicit lifetime bound `T: ReEarlyBound(0, 'a)`...
note: No external requirements
- --> $DIR/ty-param-closure-outlives-from-return-type.rs:26:1
+ --> $DIR/ty-param-closure-outlives-from-return-type.rs:25:1
|
LL | / fn no_region<'a, T>(x: Box<T>) -> Box<dyn Debug + 'a>
LL | | where
]
error[E0309]: the parameter type `T` may not live long enough
- --> $DIR/ty-param-closure-outlives-from-return-type.rs:53:5
+ --> $DIR/ty-param-closure-outlives-from-return-type.rs:52:5
|
LL | x
| ^
// compile-flags:-Zborrowck=mir -Zverbose
#![allow(warnings)]
-#![feature(dyn_trait)]
#![feature(rustc_attrs)]
use std::cell::Cell;
warning: not reporting region error due to nll
- --> $DIR/ty-param-closure-outlives-from-where-clause.rs:45:9
+ --> $DIR/ty-param-closure-outlives-from-where-clause.rs:44:9
|
LL | require(&x, &y)
| ^^^^^^^
warning: not reporting region error due to nll
- --> $DIR/ty-param-closure-outlives-from-where-clause.rs:79:9
+ --> $DIR/ty-param-closure-outlives-from-where-clause.rs:78:9
|
LL | require(&x, &y)
| ^^^^^^^
note: External requirements
- --> $DIR/ty-param-closure-outlives-from-where-clause.rs:38:26
+ --> $DIR/ty-param-closure-outlives-from-where-clause.rs:37:26
|
LL | with_signature(a, b, |x, y| {
| __________________________^
= note: where T: '_#1r
error[E0309]: the parameter type `T` may not live long enough
- --> $DIR/ty-param-closure-outlives-from-where-clause.rs:38:26
+ --> $DIR/ty-param-closure-outlives-from-where-clause.rs:37:26
|
LL | with_signature(a, b, |x, y| {
| __________________________^
= help: consider adding an explicit lifetime bound `T: ReFree(DefId(0/0:6 ~ ty_param_closure_outlives_from_where_clause[317d]::no_region[0]), BrNamed(crate0:DefIndex(1:14), 'a))`...
note: No external requirements
- --> $DIR/ty-param-closure-outlives-from-where-clause.rs:37:1
+ --> $DIR/ty-param-closure-outlives-from-where-clause.rs:36:1
|
LL | / fn no_region<'a, T>(a: Cell<&'a ()>, b: T) {
LL | | with_signature(a, b, |x, y| {
]
note: External requirements
- --> $DIR/ty-param-closure-outlives-from-where-clause.rs:55:26
+ --> $DIR/ty-param-closure-outlives-from-where-clause.rs:54:26
|
LL | with_signature(a, b, |x, y| {
| __________________________^
= note: where T: '_#2r
note: No external requirements
- --> $DIR/ty-param-closure-outlives-from-where-clause.rs:51:1
+ --> $DIR/ty-param-closure-outlives-from-where-clause.rs:50:1
|
LL | / fn correct_region<'a, T>(a: Cell<&'a ()>, b: T)
LL | | where
]
note: External requirements
- --> $DIR/ty-param-closure-outlives-from-where-clause.rs:76:26
+ --> $DIR/ty-param-closure-outlives-from-where-clause.rs:75:26
|
LL | with_signature(a, b, |x, y| {
| __________________________^
= note: where T: '_#2r
error[E0309]: the parameter type `T` may not live long enough
- --> $DIR/ty-param-closure-outlives-from-where-clause.rs:76:26
+ --> $DIR/ty-param-closure-outlives-from-where-clause.rs:75:26
|
LL | with_signature(a, b, |x, y| {
| __________________________^
= help: consider adding an explicit lifetime bound `T: ReFree(DefId(0/0:8 ~ ty_param_closure_outlives_from_where_clause[317d]::wrong_region[0]), BrNamed(crate0:DefIndex(1:20), 'a))`...
note: No external requirements
- --> $DIR/ty-param-closure-outlives-from-where-clause.rs:72:1
+ --> $DIR/ty-param-closure-outlives-from-where-clause.rs:71:1
|
LL | / fn wrong_region<'a, 'b, T>(a: Cell<&'a ()>, b: T)
LL | | where
]
note: External requirements
- --> $DIR/ty-param-closure-outlives-from-where-clause.rs:90:26
+ --> $DIR/ty-param-closure-outlives-from-where-clause.rs:89:26
|
LL | with_signature(a, b, |x, y| {
| __________________________^
= note: where T: '_#3r
note: No external requirements
- --> $DIR/ty-param-closure-outlives-from-where-clause.rs:85:1
+ --> $DIR/ty-param-closure-outlives-from-where-clause.rs:84:1
|
LL | / fn outlives_region<'a, 'b, T>(a: Cell<&'a ()>, b: T)
LL | | where
#![feature(nll)]
#![allow(warnings)]
-#![feature(dyn_trait)]
use std::cell::Cell;
error[E0309]: the parameter type `T` may not live long enough
- --> $DIR/ty-param-fn-body-nll-feature.rs:31:5
+ --> $DIR/ty-param-fn-body-nll-feature.rs:30:5
|
LL | outlives(cell, t)
| ^^^^^^^^^^^^^^^^^
// function body.
#![allow(warnings)]
-#![feature(dyn_trait)]
use std::cell::Cell;
warning: not reporting region error due to nll
- --> $DIR/ty-param-fn-body.rs:30:5
+ --> $DIR/ty-param-fn-body.rs:29:5
|
LL | outlives(cell, t)
| ^^^^^^^^
error[E0309]: the parameter type `T` may not live long enough
- --> $DIR/ty-param-fn-body.rs:30:5
+ --> $DIR/ty-param-fn-body.rs:29:5
|
LL | outlives(cell, t)
| ^^^^^^^^^^^^^^^^^
// compile-flags:-Zborrowck=mir
#![allow(warnings)]
-#![feature(dyn_trait)]
use std::fmt::Debug;
warning: not reporting region error due to nll
- --> $DIR/ty-param-fn.rs:22:5
+ --> $DIR/ty-param-fn.rs:21:5
|
LL | x
| ^
warning: not reporting region error due to nll
- --> $DIR/ty-param-fn.rs:38:5
+ --> $DIR/ty-param-fn.rs:37:5
|
LL | x
| ^
error[E0309]: the parameter type `T` may not live long enough
- --> $DIR/ty-param-fn.rs:22:5
+ --> $DIR/ty-param-fn.rs:21:5
|
LL | x
| ^
= help: consider adding an explicit lifetime bound `T: 'a`...
error[E0309]: the parameter type `T` may not live long enough
- --> $DIR/ty-param-fn.rs:38:5
+ --> $DIR/ty-param-fn.rs:37:5
|
LL | x
| ^
// compile-flags: -Z parse-only
-#![feature(dyn_trait)]
#![feature(raw_identifiers)]
fn test_if() {
error: expected one of `!`, `.`, `::`, `;`, `?`, `{`, `}`, or an operator, found `true`
- --> $DIR/raw-literal-keywords.rs:17:10
+ --> $DIR/raw-literal-keywords.rs:16:10
|
LL | r#if true { } //~ ERROR found `true`
| ^^^^ expected one of 8 possible tokens here
error: expected one of `!`, `.`, `::`, `;`, `?`, `{`, `}`, or an operator, found `Test`
- --> $DIR/raw-literal-keywords.rs:21:14
+ --> $DIR/raw-literal-keywords.rs:20:14
|
LL | r#struct Test; //~ ERROR found `Test`
| ^^^^ expected one of 8 possible tokens here
error: expected one of `!`, `.`, `::`, `;`, `?`, `{`, `}`, or an operator, found `Test`
- --> $DIR/raw-literal-keywords.rs:25:13
+ --> $DIR/raw-literal-keywords.rs:24:13
|
LL | r#union Test; //~ ERROR found `Test`
| ^^^^ expected one of 8 possible tokens here
//
// cc #48468
-#![feature(dyn_trait)]
-
use std::fmt::Debug;
struct Foo {
error[E0106]: missing lifetime specifier
- --> $DIR/dyn-trait-underscore-in-struct.rs:21:24
+ --> $DIR/dyn-trait-underscore-in-struct.rs:19:24
|
LL | x: Box<dyn Debug + '_>, //~ ERROR missing lifetime specifier
| ^^ expected lifetime parameter
error[E0228]: the lifetime bound for this object type cannot be deduced from context; please supply an explicit bound
- --> $DIR/dyn-trait-underscore-in-struct.rs:21:12
+ --> $DIR/dyn-trait-underscore-in-struct.rs:19:12
|
LL | x: Box<dyn Debug + '_>, //~ ERROR missing lifetime specifier
| ^^^^^^^^^^^^^^
warning: not reporting region error due to nll
- --> $DIR/dyn-trait-underscore.rs:20:14
+ --> $DIR/dyn-trait-underscore.rs:18:14
|
LL | Box::new(items.iter()) //~ ERROR cannot infer an appropriate lifetime
| ^^^^^
warning: not reporting region error due to nll
- --> $DIR/dyn-trait-underscore.rs:20:20
+ --> $DIR/dyn-trait-underscore.rs:18:20
|
LL | Box::new(items.iter()) //~ ERROR cannot infer an appropriate lifetime
| ^^^^
warning: not reporting region error due to nll
- --> $DIR/dyn-trait-underscore.rs:20:5
+ --> $DIR/dyn-trait-underscore.rs:18:5
|
LL | Box::new(items.iter()) //~ ERROR cannot infer an appropriate lifetime
| ^^^^^^^^
warning: not reporting region error due to nll
- --> $DIR/dyn-trait-underscore.rs:20:5
+ --> $DIR/dyn-trait-underscore.rs:18:5
|
LL | Box::new(items.iter()) //~ ERROR cannot infer an appropriate lifetime
| ^^^^^^^^^^^^^^^^^^^^^^
error: free region `` does not outlive free region `'static`
- --> $DIR/dyn-trait-underscore.rs:18:52
+ --> $DIR/dyn-trait-underscore.rs:16:52
|
LL | fn a<T>(items: &[T]) -> Box<dyn Iterator<Item=&T>> {
| ____________________________________________________^
//
// cc #48468
-#![feature(dyn_trait)]
-
fn a<T>(items: &[T]) -> Box<dyn Iterator<Item=&T>> {
// ^^^^^^^^^^^^^^^^^^^^^ bound *here* defaults to `'static`
Box::new(items.iter()) //~ ERROR cannot infer an appropriate lifetime
error[E0495]: cannot infer an appropriate lifetime for autoref due to conflicting requirements
- --> $DIR/dyn-trait-underscore.rs:20:20
+ --> $DIR/dyn-trait-underscore.rs:18:20
|
LL | Box::new(items.iter()) //~ ERROR cannot infer an appropriate lifetime
| ^^^^
|
-note: first, the lifetime cannot outlive the anonymous lifetime #1 defined on the function body at 18:1...
- --> $DIR/dyn-trait-underscore.rs:18:1
+note: first, the lifetime cannot outlive the anonymous lifetime #1 defined on the function body at 16:1...
+ --> $DIR/dyn-trait-underscore.rs:16:1
|
LL | / fn a<T>(items: &[T]) -> Box<dyn Iterator<Item=&T>> {
LL | | // ^^^^^^^^^^^^^^^^^^^^^ bound *here* defaults to `'static`
LL | | }
| |_^
note: ...so that reference does not outlive borrowed content
- --> $DIR/dyn-trait-underscore.rs:20:14
+ --> $DIR/dyn-trait-underscore.rs:18:14
|
LL | Box::new(items.iter()) //~ ERROR cannot infer an appropriate lifetime
| ^^^^^