jiebi/CodeConvo huggingface dataset:
/// instance, it will behave *as if* an instance of the type `T` were /// present for the purpose of various automatic analyses. /// <del> /// For example, embedding a `PhantomData<T>` will inform the compiler </del> <ins> /// # Examples /// /// When handling external resources over a foreign function interface, `PhantomData<T>` can /// prevent mismatches by enforcing types in the method implementations, although the struct /// doesn't actually contain values of the resource type. /// /// ``` /// # trait ResType { fn foo(&self); }; /// # struct ParamType; /// # mod foreign_lib { /// # pub fn new(_: usize) -> *mut () { 42 as *mut () } /// # pub fn do_stuff(_: *mut (), _: usize) {} /// # } /// # fn convert_params(_: ParamType) -> usize { 42 } /// use std::marker::PhantomData; /// use std::mem; /// /// struct ExternalResource<R> { ///    resource_handle: *mut (), ///    resource_type: PhantomData<R>, /// } /// /// impl<R: ResType> ExternalResource<R> { ///     fn new() -> ExternalResource<R> { ///         let size_of_res = mem::size_of::<R>(); ///         ExternalResource { ///             resource_handle: foreign_lib::new(size_of_res), ///             resource_type: PhantomData, ///         } ///     } /// ///     fn do_stuff(&self, param: ParamType) { ///         let foreign_params = convert_params(param); ///         foreign_lib::do_stuff(self.resource_handle, foreign_params); ///     } /// } /// ``` /// /// Another example: embedding a `PhantomData<T>` will inform the compiler </ins> /// that one or more instances of the type `T` could be dropped when /// instances of the type itself is dropped, though that may not be /// apparent from the other structure of the type itself. This is
/// The different kinds of types recognized by the compiler pub enum Ty_ { TyVec(P<Ty>), <del> /// A fixed length array (`[T, ..n]`) </del> <ins> /// A fixed length array (`[T; n]`) </ins> TyFixedLengthVec(P<Ty>, P<Expr>), /// A raw pointer (`*const T` or `*mut T`) TyPtr(MutTy),
// option. This file may not be copied, modified, or distributed // except according to those terms. <ins> #![feature(associated_consts)] </ins> pub use self::sub::{Bar, Baz}; pub trait Trait { fn foo(&self); <ins> type Assoc; const CONST: u32; </ins> } struct Foo; impl Foo { pub fn new() {} <ins> pub const C: u32 = 0; </ins> } mod sub {
use use_from_trait_xc::Trait::foo; //~^ ERROR `foo` is not directly importable <ins> use use_from_trait_xc::Trait::Assoc; //~^ ERROR `Assoc` is not directly importable use use_from_trait_xc::Trait::CONST; //~^ ERROR `CONST` is not directly importable </ins> use use_from_trait_xc::Foo::new; //~^ ERROR `new` is not directly importable <ins> use use_from_trait_xc::Foo::C; //~^ ERROR unresolved import `use_from_trait_xc::Foo::C` </ins> use use_from_trait_xc::Bar::new as bnew; //~^ ERROR `bnew` is not directly importable
// option. This file may not be copied, modified, or distributed // except according to those terms. <ins> #![feature(associated_consts)] </ins> use Trait::foo; //~^ ERROR `foo` is not directly importable <ins> use Trait::Assoc; //~^ ERROR `Assoc` is not directly importable use Trait::C; //~^ ERROR `C` is not directly importable </ins> use Foo::new; //~^ ERROR unresolved import `Foo::new`. Not a module `Foo` <ins> use Foo::C2; //~^ ERROR unresolved import `Foo::C2`. Not a module `Foo` </ins> pub trait Trait { fn foo(); <ins> type Assoc; const C: u32; </ins> } struct Foo; impl Foo { fn new() {} <ins> const C2: u32 = 0; </ins> } fn main() {}
/// This function does not perform any I/O, it simply informs this object /// that some amount of its buffer, returned from `fill_buf`, has been /// consumed and should no longer be returned. <ins> /// /// This function is used to tell the buffer how many bytes you've consumed /// from the return value of `fill_buf`, and so may do odd things if /// `fill_buf` isn't called before calling this. /// /// The `amt` must be `<=` the number of bytes in the buffer returned by `fill_buf`. </ins> #[stable(feature = "rust1", since = "1.0.0")] fn consume(&mut self, amt: usize);
<ins> // Copyright 2014 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. enum Foo { Bar } fn main() { Foo::Bar.a; //~^ ERROR: attempted access of field `a` on type `Foo`, but no field with that name was found } </ins>
use std::num::wrapping::OverflowingOps; use std::cmp::Ordering; use std::collections::hash_map::Entry::Vacant; <del> use std::{i8, i16, i32, i64}; </del> <ins> use std::{i8, i16, i32, i64, u8, u16, u32, u64}; </ins> use std::rc::Rc; fn lookup_const<'a>(tcx: &'a ty::ctxt, e: &Expr) -> Option<&'a Expr> {
Ok(const_uint((!a).wrapping_add(1))) } <ins> fn const_uint_not(a: u64, opt_ety: Option<UintTy>) -> const_val { let mask = match opt_ety { Some(UintTy::U8) => u8::MAX as u64, Some(UintTy::U16) => u16::MAX as u64, Some(UintTy::U32) => u32::MAX as u64, None | Some(UintTy::U64) => u64::MAX, }; const_uint(!a & mask) } </ins> macro_rules! overflow_checking_body { ($a:ident, $b:ident, $ety:ident, $overflowing_op:ident, lhs: $to_8_lhs:ident $to_16_lhs:ident $to_32_lhs:ident,
ast::ExprUnary(ast::UnNot, ref inner) => { match try!(eval_const_expr_partial(tcx, &**inner, ety)) { const_int(i) => const_int(!i), <del> const_uint(i) => const_uint(!i), </del> <ins> const_uint(i) => const_uint_not(i, expr_uint_type), </ins> const_bool(b) => const_bool(!b), const_str(_) => signal!(e, NotOnString), const_float(_) => signal!(e, NotOnFloat),
<ins> // Copyright 2015 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. const U8_MAX_HALF: u8 = !0u8 / 2; const U16_MAX_HALF: u16 = !0u16 / 2; const U32_MAX_HALF: u32 = !0u32 / 2; const U64_MAX_HALF: u64 = !0u64 / 2; fn main() { assert_eq!(U8_MAX_HALF, 0x7f); assert_eq!(U16_MAX_HALF, 0x7fff); assert_eq!(U32_MAX_HALF, 0x7fff_ffff); assert_eq!(U64_MAX_HALF, 0x7fff_ffff_ffff_ffff); } </ins>
let mut where_predicates = where_predicates.into_iter().flat_map(|p| clean_predicate(*p, cx)).collect::<Vec<_>>(); <del> // Type parameters have a Sized bound by default unless removed with // ?Sized. Scan through the predicates and mark any type parameter with // a Sized bound, removing the bounds as we find them. </del> <ins> // In the surface language, all type parameters except `Self` have an // implicit `Sized` bound unless removed with `?Sized`. // However, in the list of where-predicates below, `Sized` appears like a // normal bound: It's either present (the type is sized) or // absent (the type is unsized) but never *maybe* (i.e. `?Sized`). </ins> // <del> // Note that associated types also have a sized bound by default, but we </del> <ins> // This is unsuitable for rendering. // Thus, as a first step remove all `Sized` bounds that should be implicit. // // Note that associated types also have an implicit `Sized` bound but we </ins> // don't actually know the set of associated types right here so that's <del> // handled in cleaning associated types </del> <ins> // handled when cleaning associated types. </ins> let mut sized_params = FxHashSet::default(); <del> where_predicates.retain(|pred| match *pred { WherePredicate::BoundPredicate { ty: Generic(ref g), ref bounds, .. } => { if bounds.iter().any(|b| b.is_sized_bound(cx)) { sized_params.insert(*g); false } else { true } </del> <ins> where_predicates.retain(|pred| { if let WherePredicate::BoundPredicate { ty: Generic(g), bounds, .. } = pred && *g != kw::SelfUpper && bounds.iter().any(|b| b.is_sized_bound(cx)) { sized_params.insert(*g); false } else { true </ins> } <del> _ => true, </del> }); <del> // Run through the type parameters again and insert a ?Sized // unbound for any we didn't find to be Sized. </del> <ins> // As a final step, go through the type parameters again and insert a // `?Sized` bound for each one we didn't find to be `Sized`. </ins> for tp in &stripped_params { <del> if matches!(tp.kind, types::GenericParamDefKind::Type { .. }) && !sized_params.contains(&tp.name) </del> <ins> if let types::GenericParamDefKind::Type { .. } = tp.kind && !sized_params.contains(&tp.name) </ins> { where_predicates.push(WherePredicate::BoundPredicate { ty: Type::Generic(tp.name),
<ins> #![crate_type = "lib"] #![crate_name = "usr"] // aux-crate:issue_24183=issue-24183.rs // edition: 2021 // @has usr/trait.U.html // @has - '//*[@class="item-decl"]' "pub trait U {" // @has - '//*[@id="method.modified"]'  // "fn modified(self) -> Self // where  //     Self: Sized" // @snapshot method_no_where_self_sized - '//*[@id="method.touch"]/*[@class="code-header"]' pub use issue_24183::U; // @has usr/trait.S.html // @has - '//*[@class="item-decl"]' 'pub trait S: Sized {' pub use issue_24183::S; </ins>
AutoTraitFinder { cx } } <ins> fn generate_for_trait( &mut self, ty: Ty<'tcx>, trait_def_id: DefId, param_env: ty::ParamEnv<'tcx>, param_env_def_id: DefId, f: &auto_trait::AutoTraitFinder<'tcx>, // If this is set, show only negative trait implementations, not positive ones. discard_positive_impl: bool, ) -> Option<Item> { let tcx = self.cx.tcx; let trait_ref = ty::TraitRef { def_id: trait_def_id, substs: tcx.mk_substs_trait(ty, &[]) }; if !self.cx.generated_synthetics.borrow_mut().insert((ty, trait_def_id)) { debug!("get_auto_trait_impl_for({:?}): already generated, aborting", trait_ref); return None; } let result = f.find_auto_trait_generics(ty, param_env, trait_def_id, |infcx, info| { let region_data = info.region_data; let names_map = tcx .generics_of(param_env_def_id) .params .iter() .filter_map(|param| match param.kind { ty::GenericParamDefKind::Lifetime => Some(param.name), _ => None, }) .map(|name| (name, Lifetime(name))) .collect(); let lifetime_predicates = Self::handle_lifetimes(&region_data, &names_map); let new_generics = self.param_env_to_generics( infcx.tcx, param_env_def_id, info.full_user_env, lifetime_predicates, info.vid_to_region, ); debug!( "find_auto_trait_generics(param_env_def_id={:?}, trait_def_id={:?}):  finished with {:?}", param_env_def_id, trait_def_id, new_generics ); new_generics }); let negative_polarity; let new_generics = match result { AutoTraitResult::PositiveImpl(new_generics) => { negative_polarity = false; if discard_positive_impl { return None; } new_generics } AutoTraitResult::NegativeImpl => { negative_polarity = true; // For negative impls, we use the generic params, but *not* the predicates, // from the original type. Otherwise, the displayed impl appears to be a // conditional negative impl, when it's really unconditional. // // For example, consider the struct Foo<T: Copy>(*mut T). Using // the original predicates in our impl would cause us to generate // `impl !Send for Foo<T: Copy>`, which makes it appear that Foo // implements Send where T is not copy. // // Instead, we generate `impl !Send for Foo<T>`, which better // expresses the fact that `Foo<T>` never implements `Send`, // regardless of the choice of `T`. let params = (tcx.generics_of(param_env_def_id), ty::GenericPredicates::default()) .clean(self.cx) .params; Generics { params, where_predicates: Vec::new() } } AutoTraitResult::ExplicitImpl => return None, }; Some(Item { source: Span::dummy(), name: None, attrs: Default::default(), visibility: Inherited, def_id: self.cx.next_def_id(param_env_def_id.krate), kind: box ImplItem(Impl { unsafety: hir::Unsafety::Normal, generics: new_generics, provided_trait_methods: Default::default(), trait_: Some(trait_ref.clean(self.cx).get_trait_type().unwrap()), for_: ty.clean(self.cx), items: Vec::new(), negative_polarity, synthetic: true, blanket_impl: None, }), }) } </ins> // FIXME(eddyb) figure out a better way to pass information about // parametrization of `ty` than `param_env_def_id`. crate fn get_auto_trait_impls(&mut self, ty: Ty<'tcx>, param_env_def_id: DefId) -> Vec<Item> {
module_trait_cache: RefCell::new(FxHashMap::default()), cache: Cache::default(), }; <ins> // Small hack to force the Sized trait to be present. // // Note that in case of `#![no_core]`, the trait is not available. if let Some(sized_trait_did) = ctxt.tcx.lang_items().sized_trait() { let mut sized_trait = build_external_trait(&mut ctxt, sized_trait_did); sized_trait.is_auto = true; ctxt.external_traits.borrow_mut().insert(sized_trait_did, sized_trait); } </ins> debug!("crate: {:?}", tcx.hir().krate()); let mut krate = tcx.sess.time("clean_crate", || clean::krate(&mut ctxt));
<ins> #![crate_name = "foo"] // @has foo/struct.Bar.html // @!has - '//h3[@id="impl-Sized"]' pub struct Bar { a: u16, } // @has foo/struct.Foo.html // @!has - '//h3[@id="impl-Sized"]' pub struct Foo<T: ?Sized>(T); // @has foo/struct.Unsized.html // @has - '//h3[@id="impl-Sized"]/code' 'impl !Sized for Unsized' pub struct Unsized { data: [u8], } </ins>
BOOL_OPTIONS="" VAL_OPTIONS="" <del> opt debug 0 "debug mode" </del> <ins> opt debug 0 "debug mode; disables optimization unless `--enable-optimize` given" </ins> opt valgrind 0 "run tests with valgrind (memcheck by default)" opt helgrind 0 "run tests with helgrind instead of memcheck" opt valgrind-rpass 1 "run rpass-valgrind tests with valgrind"
} } <ins> /// An error which can be returned when parsing a char. #[stable(feature = "char_from_str", since = "1.19.0")] #[derive(Clone, Debug)] pub struct ParseCharError { kind: CharErrorKind, } impl ParseCharError { #[unstable(feature = "char_error_internals", reason = "this method should not be available publicly", issue = "0")] #[doc(hidden)] pub fn __description(&self) -> &str { match self.kind { CharErrorKind::EmptyString => { "cannot parse char from empty string" }, CharErrorKind::TooManyChars => "too many characters in string" } } } #[derive(Copy, Clone, Debug, PartialEq, Eq)] enum CharErrorKind { EmptyString, TooManyChars, } #[stable(feature = "char_from_str", since = "1.19.0")] impl fmt::Display for ParseCharError { fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { self.__description().fmt(f) } } #[stable(feature = "char_from_str", since = "1.19.0")] impl FromStr for char { type Err = ParseCharError; #[inline] fn from_str(s: &str) -> Result<Self, Self::Err> { let mut chars = s.chars(); match (chars.next(), chars.next()) { (None, _) => { Err(ParseCharError { kind: CharErrorKind::EmptyString }) }, (Some(c), None) => Ok(c), _ => { Err(ParseCharError { kind: CharErrorKind::TooManyChars }) } } } } </ins> #[unstable(feature = "try_from", issue = "33417")] impl TryFrom<u32> for char { type Error = CharTryFromError;
} #[test] <ins> fn test_from_str() { assert_eq!(char::from_str("a").unwrap(), 'a'); assert_eq!(char::try_from("a").unwrap(), 'a'); assert_eq!(char::from_str("0").unwrap(), '0'); assert_eq!(char::from_str("u{D7FF}").unwrap(), 'u{d7FF}'); assert!(char::from_str("").is_err()); assert!(char::from_str("abc").is_err()); } #[test] </ins> fn test_is_lowercase() { assert!('a'.is_lowercase()); assert!('ö'.is_lowercase());
pub use core::char::{MAX, from_digit, from_u32, from_u32_unchecked}; #[stable(feature = "rust1", since = "1.0.0")] pub use core::char::{EscapeDebug, EscapeDefault, EscapeUnicode}; <ins> #[stable(feature = "char_from_str", since = "1.19.0")] pub use core::char::ParseCharError; </ins> // unstable reexports #[unstable(feature = "try_from", issue = "33417")]
let info = Load(bcx, get_len(bcx, base_datum.val)); Store(bcx, info, get_len(bcx, scratch.val)); <del> DatumBlock::new(bcx, scratch.to_expr_datum()) </del> <ins> // Always generate an lvalue datum, because this pointer doesn't own // the data and cleanup is scheduled elsewhere. DatumBlock::new(bcx, Datum::new(scratch.val, scratch.ty, LvalueExpr)) </ins> } })
<ins> // Copyright 2015 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. use std::rc::Rc; struct Foo<'r>(&'r mut i32); impl<'r> Drop for Foo<'r> { fn drop(&mut self) { *self.0 += 1; } } fn main() { let mut drops = 0; { let _: Rc<Send> = Rc::new(Foo(&mut drops)); } assert_eq!(1, drops); } </ins>
<ins> // Copyright 2015 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. struct Foo<'r>(&'r mut i32); impl<'r> Drop for Foo<'r> { fn drop(&mut self) { *self.0 += 1; } } trait Trait {} impl<'r> Trait for Foo<'r> {} struct Holder<T: ?Sized>(T); fn main() { let mut drops = 0; { let y = &Holder([Foo(&mut drops)]) as &Holder<[Foo]>; // this used to cause an extra drop of the Foo instance let x = &y.0; } assert_eq!(1, drops); drops = 0; { let y = &Holder(Foo(&mut drops)) as &Holder<Trait>; // this used to cause an extra drop of the Foo instance let x = &y.0; } assert_eq!(1, drops); } </ins>
## Macros ```antlr <del> expr_macro_rules : "macro_rules" '!' ident '(' macro_rule * ')' ; </del> <ins> expr_macro_rules : "macro_rules" '!' ident '(' macro_rule * ')' ';' | "macro_rules" '!' ident '{' macro_rule * '}' ; </ins> macro_rule : '(' matcher * ')' "=>" '(' transcriber * ')' ';' ; matcher : '(' matcher * ')' | '[' matcher * ']' | '{' matcher * '}' | '$' ident ':' ident
use dep_graph::DepGraph; use middle::infer::InferCtxt; <del> use middle::ty::{self, Ty, TypeFoldable}; </del> <ins> use middle::ty::{self, Ty, TypeFoldable, ToPolyTraitRef}; </ins> use rustc_data_structures::obligation_forest::{Backtrace, ObligationForest, Error}; use std::iter; use syntax::ast;
} } <ins> /// Return the set of type variables contained in a trait ref fn trait_ref_type_vars<'a, 'tcx>(selcx: &mut SelectionContext<'a, 'tcx>, t: ty::PolyTraitRef<'tcx>) -> Vec<Ty<'tcx>> { t.skip_binder() // ok b/c this check doesn't care about regions .input_types() .iter() .map(|t| selcx.infcx().resolve_type_vars_if_possible(t)) .filter(|t| t.has_infer_types()) .flat_map(|t| t.walk()) .filter(|t| match t.sty { ty::TyInfer(_) => true, _ => false }) .collect() } </ins> /// Processes a predicate obligation and returns either: /// - `Ok(Some(v))` if the predicate is true, presuming that `v` are also true /// - `Ok(None)` if we don't have enough info to be sure
// doing more work yet if !pending_obligation.stalled_on.is_empty() { if pending_obligation.stalled_on.iter().all(|&ty| { <del> let resolved_ty = selcx.infcx().resolve_type_vars_if_possible(&ty); </del> <ins> let resolved_ty = selcx.infcx().shallow_resolve(&ty); </ins> resolved_ty == ty // nothing changed here }) { debug!("process_predicate: pending obligation {:?} still stalled on {:?}",
// of its type, and those types are resolved at // the same time. pending_obligation.stalled_on = <del> data.skip_binder() // ok b/c this check doesn't care about regions .input_types() .iter() .map(|t| selcx.infcx().resolve_type_vars_if_possible(t)) .filter(|t| t.has_infer_types()) .flat_map(|t| t.walk()) .filter(|t| match t.sty { ty::TyInfer(_) => true, _ => false }) .collect(); </del> <ins> trait_ref_type_vars(selcx, data.to_poly_trait_ref()); </ins> debug!("process_predicate: pending obligation {:?} now stalled on {:?}", selcx.infcx().resolve_type_vars_if_possible(obligation),
ty::Predicate::Projection(ref data) => { let project_obligation = obligation.with(data.clone()); match project::poly_project_and_unify_type(selcx, &project_obligation) { <ins> Ok(None) => { pending_obligation.stalled_on = trait_ref_type_vars(selcx, data.to_poly_trait_ref()); Ok(None) } </ins> Ok(v) => Ok(v), Err(e) => Err(CodeProjectionError(e)) }
} ty::Predicate::WellFormed(ty) => { <del> Ok(ty::wf::obligations(selcx.infcx(), obligation.cause.body_id, ty, obligation.cause.span)) </del> <ins> match ty::wf::obligations(selcx.infcx(), obligation.cause.body_id, ty, obligation.cause.span) { None => { pending_obligation.stalled_on = vec![ty]; Ok(None) } s => Ok(s) } </ins> } } }
impl<'tcx> ToPolyTraitRef<'tcx> for PolyTraitPredicate<'tcx> { fn to_poly_trait_ref(&self) -> PolyTraitRef<'tcx> { <del> self.map_bound_ref(|trait_pred| trait_pred.trait_ref.clone()) </del> <ins> self.map_bound_ref(|trait_pred| trait_pred.trait_ref) </ins> } }
<ins> // 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. fn main() { macro_rules! f { () => { 0 + 0 } } // 16 per line f!();f!();f!();f!();f!();f!();f!();f!();f!();f!();f!();f!();f!();f!();f!();f!(); f!();f!();f!();f!();f!();f!();f!();f!();f!();f!();f!();f!();f!();f!();f!();f!(); f!();f!();f!();f!();f!();f!();f!();f!();f!();f!();f!();f!();f!();f!();f!();f!(); f!();f!();f!();f!();f!();f!();f!();f!();f!();f!();f!();f!();f!();f!();f!();f!(); f!();f!();f!();f!();f!();f!();f!();f!();f!();f!();f!();f!();f!();f!();f!();f!(); f!();f!();f!();f!();f!();f!();f!();f!();f!();f!();f!();f!();f!();f!();f!();f!(); f!();f!();f!();f!();f!();f!();f!();f!();f!();f!();f!();f!();f!();f!();f!();f!(); f!();f!();f!();f!();f!();f!();f!();f!();f!();f!();f!();f!();f!();f!();f!();f!(); f!();f!();f!();f!();f!();f!();f!();f!();f!();f!();f!();f!();f!();f!();f!();f!(); f!();f!();f!();f!();f!();f!();f!();f!();f!();f!();f!();f!();f!();f!();f!();f!(); f!();f!();f!();f!();f!();f!();f!();f!();f!();f!();f!();f!();f!();f!();f!();f!(); f!();f!();f!();f!();f!();f!();f!();f!();f!();f!();f!();f!();f!();f!();f!();f!(); f!();f!();f!();f!();f!();f!();f!();f!();f!();f!();f!();f!();f!();f!();f!();f!(); f!();f!();f!();f!();f!();f!();f!();f!();f!();f!();f!();f!();f!();f!();f!();f!(); f!();f!();f!();f!();f!();f!();f!();f!();f!();f!();f!();f!();f!();f!();f!();f!(); f!();f!();f!();f!();f!();f!();f!();f!();f!();f!();f!();f!();f!();f!();f!();f!(); } </ins>
tts: vec![TtToken(sp, token::Ident(token::str_to_ident("doc"), token::Plain)), TtToken(sp, token::Eq), <del> TtToken(sp, token::Literal(token::Str_(name), None))], </del> <ins> TtToken(sp, token::Literal(token::StrRaw(name, 0), None))], </ins> close_span: sp, })) }
<ins> // Copyright 2015 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. // When expanding a macro, documentation attributes (including documentation comments) must be // passed "as is" without being parsed. Otherwise, some text will be incorrectly interpreted as // escape sequences, leading to an ICE. // // Related issues: #25929, #25943 macro_rules! homura { (#[$x:meta]) => () } homura! { /// madoka x41 } fn main() { } </ins>
<ins> // ignore-tidy-linelength // regression test for #26376 trait Foo { fn foo(&self) -> [u8]; } fn foo(f: Option<&dyn Foo>) { if let Some(f) = f { let _ = f.foo(); //~^ ERROR cannot move a value of type [u8]: the size of [u8] cannot be statically determined } } fn main() { foo(None) } </ins>