jiebi/CodeConvo huggingface dataset:
self.check_for_for_in_in_typo(self.prev_token.span); let expr = self.parse_expr_res(Restrictions::NO_STRUCT_LITERAL, None)?; <del> let pat = self.recover_parens_around_for_head(pat, &expr, begin_paren); </del> <ins> let pat = self.recover_parens_around_for_head(pat, begin_paren); </ins> let (iattrs, loop_block) = self.parse_inner_attrs_and_block()?; attrs.extend(iattrs);
LL |     for ( elem in vec ) { |                ^^ expected one of `)`, `,`, `@`, or `|` <del> error: unexpected closing `)` --> $DIR/recover-for-loop-parens-around-head.rs:10:23 </del> <ins> error: unexpected parenthesis surrounding `for` loop head --> $DIR/recover-for-loop-parens-around-head.rs:10:9 </ins> | LL |     for ( elem in vec ) { <del> |         --------------^ |         | |         opening `(` |         help: remove parenthesis in `for` loop: `elem in vec` </del> <ins> |         ^             ^ | help: remove parenthesis in `for` loop | LL -     for ( elem in vec ) { LL +     for  elem in vec  { | </ins> error[E0308]: mismatched types --> $DIR/recover-for-loop-parens-around-head.rs:13:38
kind_name = "variant"; } None => { <del> let resolved_expected = fcx.infcx().ty_to_str(fcx.infcx().resolve_type_vars_if_possible(expected)); fcx.infcx().type_error_message_str(pat.span, |actual| { </del> <ins> fcx.infcx().type_error_message_str_with_expected(pat.span, |expected, actual| { expected.map_default(~"", |&e| { </ins> fmt!("mismatched types: expected `%s` but found %s", <del> resolved_expected, actual)}, ~"a structure pattern", </del> <ins> e, actual)})}, Some(expected), ~"a structure pattern", </ins> None); fcx.write_error(pat.id); kind_name = "[error]";
kind_name = "structure"; } _ => { <del> let resolved_expected = fcx.infcx().ty_to_str(fcx.infcx().resolve_type_vars_if_possible(expected)); fcx.infcx().type_error_message_str(pat.span, |actual| { </del> <ins> fcx.infcx().type_error_message_str_with_expected(pat.span, |expected, actual| { expected.map_default(~"", |&e| { </ins> fmt!("mismatched types: expected `%s` but found %s", <del> resolved_expected, actual)}, ~"an enum or structure pattern", </del> <ins> e, actual)})}, Some(expected), ~"an enum or structure pattern", </ins> None); fcx.write_error(pat.id); kind_name = "[error]";
for elts.each |elt| { check_pat(pcx, *elt, ty::mk_err()); } <del> let actual = ty::mk_tup(tcx, elts.map(|pat_var| { fcx.node_ty(pat_var.id) })); </del> // use terr_tuple_size if both types are tuples let type_error = match s { ty::ty_tup(ref ex_elts) =>
found: e_count}), _ => ty::terr_mismatch }; <del> fcx.infcx().report_mismatched_types(pat.span, expected, actual, &type_error); </del> <ins> fcx.infcx().type_error_message_str_with_expected(pat.span, |expected, actual| { expected.map_default(~"", |&e| { fmt!("mismatched types: expected `%s` but found %s", e, actual)})}, Some(expected), ~"tuple", Some(&type_error)); </ins> fcx.write_error(pat.id); } }
for after.each |&elt| { check_pat(pcx, elt, ty::mk_err()); } <del> let resolved_expected = fcx.infcx().ty_to_str(fcx.infcx().resolve_type_vars_if_possible(expected)); fcx.infcx().type_error_message_str(pat.span, |actual| { fmt!("mismatched types: expected `%s` but found %s", resolved_expected, actual)}, ~"a vector pattern", None); </del> <ins> fcx.infcx().type_error_message_str_with_expected( pat.span, |expected, actual| { expected.map_default(~"", |&e| { fmt!("mismatched types: expected `%s` but found %s", e, actual)})}, Some(expected), ~"a vector pattern", None); </ins> fcx.write_error(pat.id); return; }
} _ => { check_pat(pcx, inner, ty::mk_err()); <del> let resolved_expected = fcx.infcx().ty_to_str(fcx.infcx().resolve_type_vars_if_possible(expected)); fcx.infcx().type_error_message_str(span, |actual| { fmt!("mismatched types: expected `%s` but found %s", resolved_expected, actual)}, fmt!("%s pattern", match pointer_kind { Managed => "an @-box", Owned => "a ~-box", Borrowed => "an &-pointer" }), None); </del> <ins> fcx.infcx().type_error_message_str_with_expected( span, |expected, actual| { expected.map_default(~"", |&e| { fmt!("mismatched types: expected `%s` but found %s", e, actual)})}, Some(expected), fmt!("%s pattern", match pointer_kind { Managed => "an @-box", Owned => "a ~-box", Borrowed => "an &-pointer" }), None); </ins> fcx.write_error(pat_id); } }
} } <ins> fn type_error_message_str(@mut self, sp: span, mk_msg: &fn(Option<~str>, ~str) -> ~str, actual_ty: ~str, err: Option<&ty::type_err>) { self.type_error_message_str_with_expected(sp, mk_msg, None, actual_ty, err) } fn type_error_message_str_with_expected(@mut self, sp: span, mk_msg: &fn(Option<~str>, ~str) -> ~str, expected_ty: Option<ty::t>, actual_ty: ~str, err: Option<&ty::type_err>) { debug!("hi! expected_ty = %?, actual_ty = %s", expected_ty, actual_ty); </ins> <del> fn type_error_message_str(@mut self, sp: span, mk_msg: &fn(~str) -> ~str, actual_ty: ~str, err: Option<&ty::type_err>) { </del> let error_str = err.map_default(~"", |t_err| fmt!(" (%s)", ty::type_err_to_str(self.tcx, *t_err))); <del> self.tcx.sess.span_err(sp, fmt!("%s%s", mk_msg(actual_ty), error_str)); for err.each |err| { ty::note_and_explain_type_err(self.tcx, *err) </del> <ins> let resolved_expected = expected_ty.map(|&e_ty| { self.resolve_type_vars_if_possible(e_ty) }); if !resolved_expected.map_default(false, |&e| { ty::type_is_error(e) }) { match resolved_expected { None => self.tcx.sess.span_err(sp, fmt!("%s%s", mk_msg(None, actual_ty), error_str)), Some(e) => { self.tcx.sess.span_err(sp, fmt!("%s%s", mk_msg(Some(self.ty_to_str(e)), actual_ty), error_str)); } } for err.each |err| { ty::note_and_explain_type_err(self.tcx, *err) } </ins> } } <del> fn type_error_message(@mut self, sp: span, mk_msg: &fn(~str) -> ~str, actual_ty: ty::t, err: Option<&ty::type_err>) { </del> <ins> fn type_error_message(@mut self, sp: span, mk_msg: &fn(~str) -> ~str, actual_ty: ty::t, err: Option<&ty::type_err>) { </ins> let actual_ty = self.resolve_type_vars_if_possible(actual_ty); // Don't report an error if actual type is ty_err.
return; } <del> self.type_error_message_str(sp, mk_msg, self.ty_to_str(actual_ty), err); </del> <ins> self.type_error_message_str(sp, |_e, a| { mk_msg(a) }, self.ty_to_str(actual_ty), err); </ins> } fn report_mismatched_types(@mut self, sp: span, e: ty::t, a: ty::t,
} match (true, false) { <del> (true, false, false) => () //~ ERROR mismatched types: expected `(bool,bool)` but found `(bool,bool,bool)` (expected a tuple with 2 elements but found one with 3 elements) </del> <ins> (true, false, false) => () //~ ERROR mismatched types: expected `(bool,bool)` but found tuple (expected a tuple with 2 elements but found one with 3 elements) </ins> } match (true, false) {
<ins> // Copyright 2013 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. fn main() { let (x, y) = (); //~ ERROR expected `()` but found tuple (types differ) return x; } </ins>  No newline at end of file
mir::BinOp::Shl => common::build_unchecked_lshift(bx, lhs, rhs), mir::BinOp::Shr => common::build_unchecked_rshift(bx, input_ty, lhs, rhs), mir::BinOp::Ne | mir::BinOp::Lt | mir::BinOp::Gt | <del> mir::BinOp::Eq | mir::BinOp::Le | mir::BinOp::Ge => if is_unit { bx.cx().const_bool(match op { mir::BinOp::Ne | mir::BinOp::Lt | mir::BinOp::Gt => false, mir::BinOp::Eq | mir::BinOp::Le | mir::BinOp::Ge => true, _ => unreachable!() }) } else if is_float { </del> <ins> mir::BinOp::Eq | mir::BinOp::Le | mir::BinOp::Ge => if is_float { </ins> bx.fcmp( base::bin_op_to_fcmp_predicate(op.to_hir_binop()), lhs, rhs
/// [`len`]: #method.len /// /// Note: This example shows the internals of `&str`. `unsafe` should not be <del> /// used to get a string slice under normal circumstances. Use `as_slice` </del> <ins> /// used to get a string slice under normal circumstances. Use `as_str` </ins> /// instead. #[stable(feature = "rust1", since = "1.0.0")] mod prim_str { }
// Correct delimiter. token::CloseDelim(d) if d == delim => { let (open_brace, open_brace_span) = self.open_braces.pop().unwrap(); <ins> let close_brace_span = self.token.span; if tts.is_empty() { let empty_block_span = open_brace_span.to(close_brace_span); self.last_delim_empty_block_spans.insert(delim, empty_block_span); } </ins> if self.open_braces.len() == 0 { // Clear up these spans to avoid suggesting them as we've found // properly matched delimiters so far for an entire block. self.matching_delim_spans.clear(); } else { self.matching_delim_spans.push( <del> (open_brace, open_brace_span, self.token.span), </del> <ins> (open_brace, open_brace_span, close_brace_span), </ins> ); } // Parse the close delimiter.
tts.into() ).into()) }, <del> token::CloseDelim(_) => { </del> <ins> token::CloseDelim(delim) => { </ins> // An unexpected closing delimiter (i.e., there is no // matching opening delimiter). let token_str = token_to_string(&self.token); let msg = format!("unexpected close delimiter: `{}`", token_str); let mut err = self.string_reader.sess.span_diagnostic .struct_span_err(self.token.span, &msg); <ins> if let Some(span) = self.last_delim_empty_block_spans.remove(&delim) { err.span_label( span, "this block is empty, you might have not meant to close it" ); } </ins> err.span_label(self.token.span, "unexpected close delimiter"); Err(err) },
} /// A delimiter token. <del> #[derive(Clone, PartialEq, RustcEncodable, RustcDecodable, Hash, Debug, Copy)] </del> <ins> #[derive(Clone, PartialEq, Eq, RustcEncodable, RustcDecodable, Hash, Debug, Copy)] </ins> pub enum DelimToken { /// A round parenthesis (i.e., `(` or `)`). Paren,
<ins> error: unexpected close delimiter: `}` --> $DIR/mismatched-delim-brace-empty-block.rs:5:1 | LL |   fn main() { |  ___________- LL | | LL | | } | |_- this block is empty, you might have not meant to close it LL |       let _ = (); LL |   } |   ^ unexpected close delimiter error: aborting due to previous error </ins>
self.is_const_fn_raw(def_id) && match self.is_unstable_const_fn(def_id) { Some(feature_name) => { // has a `rustc_const_unstable` attribute, check whether the user enabled the <del> // corresponding feature gate, const_constructor is not a lib feature, so has // to be checked separately. </del> <ins> // corresponding feature gate. </ins> self.features() .declared_lib_features .iter() .any(|&(sym, _)| sym == feature_name) <del> || (feature_name == sym::const_constructor && self.features().const_constructor) </del> }, // functions without const stability are either stable user written // const fn or the user is using feature gates and we thus don't
/// Whether the `def_id` is an unstable const fn and what feature gate is necessary to enable it pub fn is_unstable_const_fn(self, def_id: DefId) -> Option<Symbol> { <del> if self.is_constructor(def_id) { Some(sym::const_constructor) } else if self.is_const_fn_raw(def_id) { </del> <ins> if self.is_const_fn_raw(def_id) { </ins> self.lookup_stability(def_id)?.const_stability } else { None
(accepted, macros_in_extern, "1.40.0", Some(49476), None), /// Allows future-proofing enums/structs with the `#[non_exhaustive]` attribute (RFC 2008). (accepted, non_exhaustive, "1.40.0", Some(44109), None), <ins> /// Allows calling constructor functions in `const fn`. (accepted, const_constructor, "1.40.0", Some(61456), None), </ins> // ------------------------------------------------------------------------- // feature-group-end: accepted features
/// Allows the user of associated type bounds. (active, associated_type_bounds, "1.34.0", Some(52662), None), <del> /// Allows calling constructor functions in `const fn`. (active, const_constructor, "1.37.0", Some(61456), None), </del> /// Allows `if/while p && let q = r && ...` chains. (active, let_chains, "1.37.0", Some(53667), None),
<ins> // revisions: min_const_fn const_fn // run-pass #![cfg_attr(const_fn, feature(const_fn))] trait ConstDefault { const DEFAULT: Self; } #[derive(PartialEq)] enum E { V(i32), W(usize), } impl ConstDefault for E { const DEFAULT: Self = Self::V(23); } impl ConstDefault for Option<i32> { const DEFAULT: Self = Self::Some(23); } impl E { const NON_DEFAULT: Self = Self::W(12); const fn local_fn() -> Self { Self::V(23) } } const fn explicit_qpath() -> E { let _x = <Option<usize>>::Some(23); <E>::W(12) } fn main() { assert!(E::DEFAULT == E::local_fn()); assert!(Option::DEFAULT == Some(23)); assert!(E::NON_DEFAULT == explicit_qpath()); } </ins>
<del> error: `std::prelude::v1::Some` is not yet stable as a const fn --> $DIR/feature-gate-const_constructor.rs:9:37 | LL | const EXTERNAL_CONST: Option<i32> = {Some}(1); |                                     ^^^^^^^^^ | = help: add `#![feature(const_constructor)]` to the crate attributes to enable error: `E::V` is not yet stable as a const fn --> $DIR/feature-gate-const_constructor.rs:12:24 | LL | const LOCAL_CONST: E = {E::V}(1); |                        ^^^^^^^^^ | = help: add `#![feature(const_constructor)]` to the crate attributes to enable error: `std::prelude::v1::Some` is not yet stable as a const fn --> $DIR/feature-gate-const_constructor.rs:17:13 | LL |     let _ = {Some}(1); |             ^^^^^^^^^ | = help: add `#![feature(const_constructor)]` to the crate attributes to enable error: `E::V` is not yet stable as a const fn --> $DIR/feature-gate-const_constructor.rs:23:13 | LL |     let _ = {E::V}(1); |             ^^^^^^^^^ | = help: add `#![feature(const_constructor)]` to the crate attributes to enable error: aborting due to 4 previous errors </del>
<del> // revisions: min_const_fn const_fn #![cfg_attr(const_fn, feature(const_fn))] enum E { V(i32), } const EXTERNAL_CONST: Option<i32> = {Some}(1); //[min_const_fn]~^ ERROR is not yet stable as a const fn //[const_fn]~^^ ERROR is not yet stable as a const fn const LOCAL_CONST: E = {E::V}(1); //[min_const_fn]~^ ERROR is not yet stable as a const fn //[const_fn]~^^ ERROR is not yet stable as a const fn const fn external_fn() { let _ = {Some}(1); //[min_const_fn]~^ ERROR is not yet stable as a const fn //[const_fn]~^^ ERROR is not yet stable as a const fn } const fn local_fn() { let _ = {E::V}(1); //[min_const_fn]~^ ERROR is not yet stable as a const fn //[const_fn]~^^ ERROR is not yet stable as a const fn } fn main() {} </del>
/// Free-form case. Only for errors that are never caught! Unsupported(String), <del> /// FIXME(#64506) Error used to work around accessing projections of /// uninhabited types. UninhabitedValue, </del> // -- Everything below is not categorized yet -- FunctionAbiMismatch(Abi, Abi), FunctionArgMismatch(Ty<'tcx>, Ty<'tcx>),
}); (present_variants.next(), present_variants.next()) }; <del> if present_first.is_none() { </del> <ins> let present_first = match present_first { present_first @ Some(_) => present_first, </ins> // Uninhabited because it has no variants, or only absent ones. <del> return tcx.layout_raw(param_env.and(tcx.types.never)); } </del> <ins> None if def.is_enum() => return tcx.layout_raw(param_env.and(tcx.types.never)), // if it's a struct, still compute a layout so that we can still compute the // field offsets None => Some(VariantIdx::new(0)), }; </ins> let is_struct = !def.is_enum() || // Only one variant is present.
use rustc::mir::interpret::truncate; use rustc::ty::{self, Ty}; use rustc::ty::layout::{ <del> self, Size, Abi, Align, LayoutOf, TyLayout, HasDataLayout, VariantIdx, PrimitiveExt </del> <ins> self, Size, Align, LayoutOf, TyLayout, HasDataLayout, VariantIdx, PrimitiveExt </ins> }; use rustc::ty::TypeFoldable;
layout::FieldPlacement::Array { stride, .. } => { let len = base.len(self)?; if field >= len { <del> // This can be violated because this runs during promotion on code where the // type system has not yet ensured that such things don't happen. </del> <ins> // This can be violated because the index (field) can be a runtime value // provided by the user. </ins> debug!("tried to access element {} of array/slice with length {}", field, len); throw_panic!(BoundsCheck { len, index: field }); } stride * field } layout::FieldPlacement::Union(count) => { <del> // FIXME(#64506) `UninhabitedValue` can be removed when this issue is resolved if base.layout.abi == Abi::Uninhabited { throw_unsup!(UninhabitedValue); } </del> assert!(field < count as u64, <del> "Tried to access field {} of union with {} fields", field, count); </del> <ins> "Tried to access field {} of union {:#?} with {} fields", field, base.layout, count); </ins> // Offset is always 0 Size::from_bytes(0) }
pub fn offset(&self, i: usize) -> Size { match *self { <del> FieldPlacement::Union(_) => Size::ZERO, </del> <ins> FieldPlacement::Union(count) => { assert!(i < count, "Tried to access field {} of union with {} fields", i, count); Size::ZERO }, </ins> FieldPlacement::Array { stride, count } => { let i = i as u64; assert!(i < count);
if let hir::ExprKind::Index(ref base, ref index) = e.kind { let mut tables = self.fcx.tables.borrow_mut(); <del> // All valid indexing looks like this; might encounter non-valid indexes at this point if let ty::Ref(_, base_ty, _) = tables.expr_ty_adjusted(&base).kind { let index_ty = tables.expr_ty_adjusted(&index); </del> <ins> // All valid indexing looks like this; might encounter non-valid indexes at this point. let base_ty = tables.expr_ty_adjusted_opt(&base).map(|t| &t.kind); if base_ty.is_none() { // When encountering `return [0][0]` outside of a `fn` body we can encounter a base // that isn't in the type table. We assume more relevant errors have already been // emitted, so we delay an ICE if none have. (#64638) self.tcx().sess.delay_span_bug(e.span, &format!("bad base: `{:?}`", base)); } if let Some(ty::Ref(_, base_ty, _)) = base_ty { let index_ty = tables.expr_ty_adjusted_opt(&index).unwrap_or_else(|| { // When encountering `return [0][0]` outside of a `fn` body we would attempt // to access an unexistend index. We assume that more relevant errors will // already have been emitted, so we only gate on this with an ICE if no // error has been emitted. (#64638) self.tcx().sess.delay_span_bug( e.span, &format!("bad index {:?} for base: `{:?}`", index, base), ); self.fcx.tcx.types.err }); </ins> let index_ty = self.fcx.resolve_vars_if_possible(&index_ty); if base_ty.builtin_index().is_some() && index_ty == self.fcx.tcx.types.usize {
// ignore it.  We can't put it on the struct header anyway. RegionKind::ReLateBound(..) => false, <ins> // This can appear in `where Self: ` bounds (#64855): // //     struct Bar<T>(<Self as Foo>::Type) where Self: ; //     struct Baz<'a>(&'a Self) where Self: ; RegionKind::ReEmpty => false, </ins> // These regions don't appear in types from type declarations: <del> RegionKind::ReEmpty | RegionKind::ReErased </del> <ins> RegionKind::ReErased </ins> | RegionKind::ReClosureBound(..) | RegionKind::ReScope(..) | RegionKind::ReVar(..)
<ins> error[E0277]: the trait bound `Bar<T>: Foo` is not satisfied --> $DIR/issue-64855.rs:5:19 | LL | pub struct Bar<T>(<Self as Foo>::Type) where Self: ; |                   ^^^^^^^^^^^^^^^^^^^ the trait `Foo` is not implemented for `Bar<T>` error: aborting due to previous error For more information about this error, try `rustc --explain E0277`. </ins>
let max_len = receiver.rfind(".").unwrap(); format!("{}{}", &receiver[..max_len], method_call) } else { <del> format!("{}{}", receiver, method_call) </del> <ins> if expr.precedence().order() < ExprPrecedence::MethodCall.order() { format!("({}){}", receiver, method_call) } else { format!("{}{}", receiver, method_call) } </ins> }; Some(if is_struct_pat_shorthand_field { format!("{}: {}", receiver, sugg)
|                                               ^^^^^^^^^^ |                                               | |                                               expected struct `std::vec::Vec`, found reference <del> |                                               help: try using a conversion method: `&[1, 2, 3].to_vec()` </del> <ins> |                                               help: try using a conversion method: `(&[1, 2, 3]).to_vec()` </ins> | = note: expected type `std::vec::Vec<usize>` found type `&[{integer}; 3]`
|             ^^^^^ |             | |             cyclic type of infinite size <del> |             help: try using a conversion method: `box x.to_string()` </del> <ins> |             help: try using a conversion method: `(box x).to_string()` </ins> error[E0055]: reached the recursion limit while auto-dereferencing `Foo` --> $DIR/infinite-autoderef.rs:25:5
= note: expected type `X<X<_, std::string::String>, _>` found type `X<X<_, {integer}>, _>` <del> error: aborting due to 6 previous errors </del> <ins> error[E0308]: mismatched types --> $DIR/abridged.rs:54:5 | LL | fn f() -> String { |           ------ expected `std::string::String` because of return type LL |     1+2 |     ^^^ |     | |     expected struct `std::string::String`, found integer |     help: try using a conversion method: `(1+2).to_string()` | = note: expected type `std::string::String` found type `{integer}` error[E0308]: mismatched types --> $DIR/abridged.rs:59:5 | LL | fn g() -> String { |           ------ expected `std::string::String` because of return type LL |     -2 |     ^^ |     | |     expected struct `std::string::String`, found integer |     help: try using a conversion method: `(-2).to_string()` | = note: expected type `std::string::String` found type `{integer}` error: aborting due to 8 previous errors </ins> For more information about this error, try `rustc --explain E0308`.
param_env: ty::ParamEnv<'tcx>, } <ins> impl<'tcx> TransferFunction<'_, '_, 'tcx> { /// Returns `true` if this borrow would allow mutation of the `borrowed_place`. fn borrow_allows_mutation( &self, kind: mir::BorrowKind, borrowed_place: &mir::Place<'tcx>, ) -> bool { let borrowed_ty = borrowed_place.ty(self.body, self.tcx).ty; // Zero-sized types cannot be mutated, since there is nothing inside to mutate. // // FIXME: For now, we only exempt arrays of length zero. We need to carefully // consider the effects before extending this to all ZSTs. if let ty::Array(_, len) = borrowed_ty.kind { if len.try_eval_usize(self.tcx, self.param_env) == Some(0) { return false; } } match kind { mir::BorrowKind::Mut { .. } => true, | mir::BorrowKind::Shared | mir::BorrowKind::Shallow | mir::BorrowKind::Unique => !borrowed_ty.is_freeze(self.tcx, self.param_env, DUMMY_SP), } } } </ins> impl<'tcx> Visitor<'tcx> for TransferFunction<'_, '_, 'tcx> { fn visit_rvalue( &mut self,
location: Location, ) { if let mir::Rvalue::Ref(_, kind, ref borrowed_place) = *rvalue { <del> let is_mut = match kind { mir::BorrowKind::Mut { .. } => true, | mir::BorrowKind::Shared | mir::BorrowKind::Shallow | mir::BorrowKind::Unique => { !borrowed_place .ty(self.body, self.tcx) .ty .is_freeze(self.tcx, self.param_env, DUMMY_SP) } }; if is_mut { </del> <ins> if self.borrow_allows_mutation(kind, borrowed_place) { </ins> match borrowed_place.base { mir::PlaceBase::Local(borrowed_local) if !borrowed_place.is_indirect() => self.trans.gen(borrowed_local),
item.tcx, item.body, item.def_id, <del> &[], </del> <ins> &item.tcx.get_attrs(item.def_id), </ins> &dead_unwinds, old_dataflow::IndirectlyMutableLocals::new(item.tcx, item.body, item.param_env), |_, local| old_dataflow::DebugFormatted::new(&local),
<ins> // Several variants of #64945. // This struct is not important, we just use it to put `T` and `'a` in scope for our associated // consts. struct Generic<'a, T>(std::marker::PhantomData<&'a T>); impl<'a, T: 'static> Generic<'a, T> { const EMPTY_SLICE: &'a [T] = { let x: &'a [T] = &[]; x }; const EMPTY_SLICE_REF: &'a &'static [T] = { let x: &'static [T] = &[]; &x //~^ ERROR `x` does not live long enough }; } static mut INTERIOR_MUT_AND_DROP: &'static [std::cell::RefCell<Vec<i32>>] = { let x: &[_] = &[]; x }; static mut INTERIOR_MUT_AND_DROP_REF: &'static &'static [std::cell::RefCell<Vec<i32>>] = { let x: &[_] = &[]; &x //~^ ERROR `x` does not live long enough }; fn main() {} </ins>