jiebi/CodeConvo huggingface dataset:
<ins> // @has 'glob_shadowing/index.html' // @count - '//div[@class="item-left module-item"]' 6 // @!has - '//div[@class="item-right docblock-short"]' 'sub1::describe' // @has - '//div[@class="item-right docblock-short"]' 'sub2::describe' // @!has - '//div[@class="item-right docblock-short"]' 'sub1::describe2' // @!has - '//div[@class="item-right docblock-short"]' 'sub1::prelude' // @has - '//div[@class="item-right docblock-short"]' 'mod::prelude' // @has - '//div[@class="item-right docblock-short"]' 'sub1::Foo (struct)' // @has - '//div[@class="item-right docblock-short"]' 'mod::Foo (function)' // @has - '//div[@class="item-right docblock-short"]' 'sub4::inner::X' // @has 'glob_shadowing/fn.describe.html' // @has - '//div[@class="docblock"]' 'sub2::describe' mod sub1 { // this should be shadowed by sub2::describe /// sub1::describe pub fn describe() -> &'static str { "sub1::describe" } // this should be shadowed by mod::prelude /// sub1::prelude pub mod prelude { } // this should *not* be shadowed, because sub1::Foo and mod::Foo are in different namespaces /// sub1::Foo (struct) pub struct Foo; // this should be shadowed, // because both sub1::describe2 and sub3::describe2 are from glob reexport /// sub1::describe2 pub fn describe2() -> &'static str { "sub1::describe2" } } mod sub2 { /// sub2::describe pub fn describe() -> &'static str { "sub2::describe" } } mod sub3 { // this should be shadowed // because both sub1::describe2 and sub3::describe2 are from glob reexport /// sub3::describe2 pub fn describe2() -> &'static str { "sub3::describe2" } } mod sub4 { // this should be shadowed by sub4::inner::X /// sub4::X pub const X: usize = 0; pub mod inner { pub use super::*; /// sub4::inner::X pub const X: usize = 1; } } /// mod::Foo (function) pub fn Foo() {} #[doc(inline)] pub use sub2::describe; #[doc(inline)] pub use sub1::*; #[doc(inline)] pub use sub3::*; #[doc(inline)] pub use sub4::inner::*; /// mod::prelude pub mod prelude {} </ins>
<ins> #![crate_name = "foo"] pub mod sub { pub struct Item; pub mod prelude { pub use super::Item; } } #[doc(inline)] pub use sub::*; // @count foo/index.html '//a[@class="mod"][@title="foo::prelude mod"]' 1 // @count foo/prelude/index.html '//div[@class="item-row"]' 0 pub mod prelude {} </ins>
<ins> #![crate_name = "foo"] pub mod sub { pub struct Item; pub mod prelude { pub use super::Item; } } // @count foo/index.html '//a[@class="mod"][@title="foo::prelude mod"]' 1 // @count foo/prelude/index.html '//div[@class="item-row"]' 0 pub mod prelude {} #[doc(inline)] pub use sub::*; </ins>
def update(self): # type: () -> None table = self.table() <del> capacity = table.GetChildMemberWithName("bucket_mask").GetValueAsUnsigned() + 1 ctrl = table.GetChildMemberWithName("ctrl").GetChildAtIndex(0) </del> <ins> inner_table = table.GetChildMemberWithName("table") </ins> <del> self.size = table.GetChildMemberWithName("items").GetValueAsUnsigned() </del> <ins> capacity = inner_table.GetChildMemberWithName("bucket_mask").GetValueAsUnsigned() + 1 ctrl = inner_table.GetChildMemberWithName("ctrl").GetChildAtIndex(0) self.size = inner_table.GetChildMemberWithName("items").GetValueAsUnsigned() </ins> self.pair_type = table.type.template_args[0] if self.pair_type.IsTypedefType(): self.pair_type = self.pair_type.GetTypedefedType() self.pair_type_size = self.pair_type.GetByteSize() <del> self.new_layout = not table.GetChildMemberWithName("data").IsValid() </del> <ins> self.new_layout = not inner_table.GetChildMemberWithName("data").IsValid() </ins> if self.new_layout: self.data_ptr = ctrl.Cast(self.pair_type.GetPointerType()) else: <del> self.data_ptr = table.GetChildMemberWithName("data").GetChildAtIndex(0) </del> <ins> self.data_ptr = inner_table.GetChildMemberWithName("data").GetChildAtIndex(0) </ins> u8_type = self.valobj.GetTarget().GetBasicType(eBasicTypeUnsignedChar) u8_type_size = self.valobj.GetTarget().GetBasicType(eBasicTypeUnsignedChar).GetByteSize()
# HashSet wraps either std HashMap or hashbrown::HashSet, which both # wrap hashbrown::HashMap, so either way we "unwrap" twice. hashbrown_hashmap = self.valobj.GetChildAtIndex(0).GetChildAtIndex(0) <del> return hashbrown_hashmap.GetChildMemberWithName("table").GetChildMemberWithName("table") </del> <ins> return hashbrown_hashmap.GetChildMemberWithName("table") </ins> def has_children(self): # type: () -> bool
/// scratch space that it may use however it wants. It will generally just do /// whatever is most efficient or otherwise easy to implement. Do not rely on /// removed data to be erased for security purposes. Even if you drop a `Vec`, its <del> /// buffer may simply be reused by another `Vec`. Even if you zero a `Vec`'s memory </del> <ins> /// buffer may simply be reused by another allocation. Even if you zero a `Vec`'s memory </ins> /// first, that might not actually happen because the optimizer does not consider /// this a side-effect that must be preserved. There is one case which we will /// not break, however: using `unsafe` code to write to the excess capacity,
emit_ptr_va_arg(bx, addr, target_ty, false, Align::from_bytes(8).unwrap(), true) } "aarch64" => emit_aapcs_va_arg(bx, addr, target_ty), <ins> "s390x" => emit_s390x_va_arg(bx, addr, target_ty), </ins> // Windows x86_64 "x86_64" if target.is_like_windows => { let target_ty_size = bx.cx.size_of(target_ty).bytes();
/// Basic implementation of a `va_list`. // The name is WIP, using `VaListImpl` for now. #[cfg(any( <del> all(not(target_arch = "aarch64"), not(target_arch = "powerpc"), not(target_arch = "x86_64")), </del> <ins> all( not(target_arch = "aarch64"), not(target_arch = "powerpc"), not(target_arch = "s390x"), not(target_arch = "x86_64") ), </ins> all(target_arch = "aarch64", any(target_os = "macos", target_os = "ios")), target_family = "wasm", target_arch = "asmjs",
_marker: PhantomData<&'f mut &'f c_void>, } <ins> /// s390x ABI implementation of a `va_list`. #[cfg(target_arch = "s390x")] #[repr(C)] #[derive(Debug)] #[unstable( feature = "c_variadic", reason = "the `c_variadic` feature has not been properly tested on  all supported platforms", issue = "44930" )] #[lang = "va_list"] pub struct VaListImpl<'f> { gpr: i64, fpr: i64, overflow_arg_area: *mut c_void, reg_save_area: *mut c_void, _marker: PhantomData<&'f mut &'f c_void>, } </ins> /// x86_64 ABI implementation of a `va_list`. #[cfg(all(target_arch = "x86_64", not(target_os = "uefi"), not(windows)))] #[repr(C)]
inner: VaListImpl<'f>, #[cfg(all( <del> any(target_arch = "aarch64", target_arch = "powerpc", target_arch = "x86_64"), </del> <ins> any( target_arch = "aarch64", target_arch = "powerpc", target_arch = "s390x", target_arch = "x86_64" ), </ins> any(not(target_arch = "aarch64"), not(any(target_os = "macos", target_os = "ios"))), not(target_family = "wasm"), not(target_arch = "asmjs"),
} #[cfg(any( <del> all(not(target_arch = "aarch64"), not(target_arch = "powerpc"), not(target_arch = "x86_64")), </del> <ins> all( not(target_arch = "aarch64"), not(target_arch = "powerpc"), not(target_arch = "s390x"), not(target_arch = "x86_64") ), </ins> all(target_arch = "aarch64", any(target_os = "macos", target_os = "ios")), target_family = "wasm", target_arch = "asmjs",
} #[cfg(all( <del> any(target_arch = "aarch64", target_arch = "powerpc", target_arch = "x86_64"), </del> <ins> any( target_arch = "aarch64", target_arch = "powerpc", target_arch = "s390x", target_arch = "x86_64" ), </ins> any(not(target_arch = "aarch64"), not(any(target_os = "macos", target_os = "ios"))), not(target_family = "wasm"), not(target_arch = "asmjs"),
use rustc_middle::middle::privacy::AccessLevels; use rustc_middle::ty::{ParamEnv, Ty, TyCtxt}; use rustc_resolve as resolve; <ins> use rustc_resolve::Namespace::TypeNS; </ins> use rustc_session::config::{self, CrateType, ErrorOutputType}; use rustc_session::lint; use rustc_session::DiagnosticOutput; use rustc_session::Session; <ins> use rustc_span::def_id::CRATE_DEF_INDEX; </ins> use rustc_span::source_map; use rustc_span::symbol::sym; <del> use rustc_span::Span; </del> <ins> use rustc_span::{Span, DUMMY_SP}; </ins> use std::cell::RefCell; use std::lazy::SyncLazy;
} crate fn create_resolver<'a>( <ins> externs: config::Externs, </ins> queries: &Queries<'a>, sess: &Session, ) -> Rc<RefCell<interface::BoxedResolver>> { let (krate, resolver, _) = &*abort_on_err(queries.expansion(), sess).peek(); let resolver = resolver.clone(); <del> crate::passes::collect_intra_doc_links::load_intra_link_crates(resolver, krate) </del> <ins> let resolver = crate::passes::collect_intra_doc_links::load_intra_link_crates(resolver, krate); // FIXME: somehow rustdoc is still missing crates even though we loaded all // the known necessary crates. Load them all unconditionally until we find a way to fix this. // DO NOT REMOVE THIS without first testing on the reproducer in // https://github.com/jyn514/objr/commit/edcee7b8124abf0e4c63873e8422ff81beb11ebb let extern_names: Vec<String> = externs .iter() .filter(|(_, entry)| entry.add_prelude) .map(|(name, _)| name) .cloned() .collect(); resolver.borrow_mut().access(|resolver| { sess.time("load_extern_crates", || { for extern_name in &extern_names { debug!("loading extern crate {}", extern_name); if let Err(()) = resolver .resolve_str_path_error( DUMMY_SP, extern_name, TypeNS, LocalDefId { local_def_index: CRATE_DEF_INDEX }.to_def_id(), ) { warn!("unable to resolve external crate {} (do you have an unused `--extern` crate?)", extern_name) } } }); }); resolver </ins> } crate fn run_global_ctxt(
// We need to hold on to the complete resolver, so we cause everything to be // cloned for the analysis passes to use. Suboptimal, but necessary in the // current architecture. <del> let resolver = core::create_resolver(queries, sess); </del> <ins> let resolver = core::create_resolver(externs, queries, sess); </ins> if sess.has_errors() { sess.fatal("Compilation failed, aborting rustdoc");
let mut loader = IntraLinkCrateLoader { current_mod: CRATE_DEF_ID, resolver }; // `walk_crate` doesn't visit the crate itself for some reason. loader.load_links_in_attrs(&krate.attrs, krate.span); <del> ast::visit::walk_crate(&mut loader, krate); </del> <ins> visit::walk_crate(&mut loader, krate); </ins> loader.resolver }
} } <del> impl ast::visit::Visitor<'_> for IntraLinkCrateLoader { </del> <ins> impl visit::Visitor<'_> for IntraLinkCrateLoader { fn visit_foreign_item(&mut self, item: &ast::ForeignItem) { self.load_links_in_attrs(&item.attrs, item.span); visit::walk_foreign_item(self, item) } </ins> fn visit_item(&mut self, item: &ast::Item) { use rustc_ast_lowering::ResolverAstLowering;
let old_mod = mem::replace(&mut self.current_mod, new_mod); self.load_links_in_attrs(&item.attrs, item.span); <del> ast::visit::walk_item(self, item); </del> <ins> visit::walk_item(self, item); </ins> self.current_mod = old_mod; } else { self.load_links_in_attrs(&item.attrs, item.span); <del> ast::visit::walk_item(self, item); </del> <ins> visit::walk_item(self, item); </ins> } } <ins> // NOTE: if doc-comments are ever allowed on function parameters, this will have to implement `visit_param` too. fn visit_assoc_item(&mut self, item: &ast::AssocItem, ctxt: visit::AssocCtxt) { self.load_links_in_attrs(&item.attrs, item.span); visit::walk_assoc_item(self, item, ctxt) } fn visit_field_def(&mut self, field: &ast::FieldDef) { self.load_links_in_attrs(&field.attrs, field.span); visit::walk_field_def(self, field) } fn visit_variant(&mut self, v: &ast::Variant) { self.load_links_in_attrs(&v.attrs, v.span); visit::walk_variant(self, v) } </ins> }
<ins> // check-pass // aux-crate:dep1=dep1.rs // aux-crate:dep2=dep2.rs // aux-crate:dep3=dep3.rs // aux-crate:dep4=dep4.rs #![deny(rustdoc::broken_intra_doc_links)] pub trait Trait { /// [dep1] type Item; } pub struct S { /// [dep2] pub x: usize, } extern "C" { /// [dep3] pub fn printf(); } pub enum E { /// [dep4] A } </ins>
pub const TRUE: BOOL = 1; pub const FALSE: BOOL = 0; <ins> pub const CSTR_LESS_THAN: c_int = 1; pub const CSTR_EQUAL: c_int = 2; pub const CSTR_GREATER_THAN: c_int = 3; </ins> pub const FILE_ATTRIBUTE_READONLY: DWORD = 0x1; pub const FILE_ATTRIBUTE_DIRECTORY: DWORD = 0x10; pub const FILE_ATTRIBUTE_REPARSE_POINT: DWORD = 0x400;
pub fn ReleaseSRWLockShared(SRWLock: PSRWLOCK); pub fn TryAcquireSRWLockExclusive(SRWLock: PSRWLOCK) -> BOOLEAN; pub fn TryAcquireSRWLockShared(SRWLock: PSRWLOCK) -> BOOLEAN; <ins> pub fn CompareStringOrdinal( lpString1: LPCWSTR, cchCount1: c_int, lpString2: LPCWSTR, cchCount2: c_int, bIgnoreCase: BOOL, ) -> c_int; </ins> } // Functions that aren't available on every version of Windows that we support,
let mut blk = Vec::new(); for (k, v) in env { <del> blk.extend(ensure_no_nuls(k.0)?.encode_wide()); </del> <ins> ensure_no_nuls(k.os_string)?; blk.extend(k.utf16); </ins> blk.push('=' as u16); blk.extend(ensure_no_nuls(v)?.encode_wide()); blk.push(0);
""u{03c0}u{042f}u{97f3}u{00e6}u{221e}"" ); } <ins> // On Windows, environment args are case preserving but comparisons are case-insensitive. // See: #85242 #[test] fn windows_env_unicode_case() { let test_cases = [ ("ä", "Ä"), ("ß", "SS"), ("Ä", "Ö"), ("Ä", "Ö"), ("I", "İ"), ("I", "i"), ("I", "ı"), ("i", "I"), ("i", "İ"), ("i", "ı"), ("İ", "I"), ("İ", "i"), ("İ", "ı"), ("ı", "I"), ("ı", "i"), ("ı", "İ"), ("ä", "Ä"), ("ß", "SS"), ("Ä", "Ö"), ("Ä", "Ö"), ("I", "İ"), ("I", "i"), ("I", "ı"), ("i", "I"), ("i", "İ"), ("i", "ı"), ("İ", "I"), ("İ", "i"), ("İ", "ı"), ("ı", "I"), ("ı", "i"), ("ı", "İ"), ]; // Test that `cmd.env` matches `env::set_var` when setting two strings that // may (or may not) be case-folded when compared. for (a, b) in test_cases.iter() { let mut cmd = Command::new("cmd"); cmd.env(a, "1"); cmd.env(b, "2"); env::set_var(a, "1"); env::set_var(b, "2"); for (key, value) in cmd.get_envs() { assert_eq!( env::var(key).ok(), value.map(|s| s.to_string_lossy().into_owned()), "command environment mismatch: {} {}", a, b ); } } } </ins>
), ); <del> llvm::set_linkage(llfn, llvm::Linkage::WeakAnyLinkage); llvm::set_visibility(llfn, llvm::Visibility::Hidden); </del> <ins> llvm::set_linkage(llfn, llvm::Linkage::PrivateLinkage); llvm::set_visibility(llfn, llvm::Visibility::Default); </ins> assert!(cx.instances.borrow_mut().insert(instance, llfn).is_none());
<ins> ../coverage/issue-85461.rs: 1|       |// Regression test for #85461: MSVC sometimes fail to link with dead code and #[inline(always)] 2|       | 3|       |extern crate inline_always_with_dead_code; 4|       | 5|       |use inline_always_with_dead_code::{bar, baz}; 6|       | 7|      1|fn main() { 8|      1|    bar::call_me(); 9|      1|    baz::call_me(); 10|      1|} ../coverage/lib/inline_always_with_dead_code.rs: 1|       |// compile-flags: -Zinstrument-coverage -Ccodegen-units=4 -Copt-level=0 2|       | 3|       |#![allow(dead_code)] 4|       | 5|       |mod foo { 6|       |    #[inline(always)] 7|      2|    pub fn called() { } 8|       | 9|      0|    fn uncalled() { } 10|       |} 11|       | 12|       |pub mod bar { 13|      1|    pub fn call_me() { 14|      1|        super::foo::called(); 15|      1|    } 16|       |} 17|       | 18|       |pub mod baz { 19|      1|    pub fn call_me() { 20|      1|        super::foo::called(); 21|      1|    } 22|       |} </ins>
<ins> // compile-flags: -Zinstrument-coverage -Ccodegen-units=4 -Copt-level=0 #![allow(dead_code)] mod foo { #[inline(always)] pub fn called() { } fn uncalled() { } } pub mod bar { pub fn call_me() { super::foo::called(); } } pub mod baz { pub fn call_me() { super::foo::called(); } } </ins>
<ins> // compile-flags: -Zinstrument-coverage -Ccodegen-units=4 --crate-type dylib -Copt-level=0 // build-pass // needs-profiler-support // Regression test for #85461 where MSVC sometimes fails to link instrument-coverage binaries // with dead code and #[inline(always)]. #![allow(dead_code)] mod foo { #[inline(always)] pub fn called() { } fn uncalled() { } } pub mod bar { pub fn call_me() { super::foo::called(); } } pub mod baz { pub fn call_me() { super::foo::called(); } } </ins>
<ins> // min-llvm-version: 15.0.0 // compile-flags: -O #![crate_type = "lib"] #[no_mangle] pub fn u16_be_to_arch(mut data: [u8; 2]) -> [u8; 2] { // CHECK-LABEL: @u16_be_to_arch // CHECK: @llvm.bswap.i16 data.reverse(); data } #[no_mangle] pub fn u32_be_to_arch(mut data: [u8; 4]) -> [u8; 4] { // CHECK-LABEL: @u32_be_to_arch // CHECK: @llvm.bswap.i32 data.reverse(); data } </ins>
let size = u64::try_from(self.force_bits(size, pointer_size)?).unwrap(); let align = vtable.read_ptr_sized(pointer_size * 2)?.check_init()?; let align = u64::try_from(self.force_bits(align, pointer_size)?).unwrap(); <ins> let align = Align::from_bytes(align) .map_err(|e| err_ub_format!("invalid vtable: alignment {}", e))?; </ins> if size >= self.tcx.data_layout.obj_size_bound() { throw_ub_format!(
<ins> // This test contains code with incorrect vtables in a const context: // - from issue 86132: a trait object with invalid alignment caused an ICE in const eval, and now //   triggers an error // - a similar test that triggers a previously-untested const UB error: emitted close to the above //   error, it checks the correctness of the size trait Trait {} const INVALID_VTABLE_ALIGNMENT: &dyn Trait = unsafe { std::mem::transmute((&92u8, &[0usize, 1usize, 1000usize])) }; //~^ ERROR any use of this value will cause an error //~| WARNING this was previously accepted by the compiler //~| invalid vtable: alignment `1000` is not a power of 2 const INVALID_VTABLE_SIZE: &dyn Trait = unsafe { std::mem::transmute((&92u8, &[1usize, usize::MAX, 1usize])) }; //~^ ERROR any use of this value will cause an error //~| WARNING this was previously accepted by the compiler //~| invalid vtable: size is bigger than largest supported object fn main() {} </ins>
<ins> error: any use of this value will cause an error --> $DIR/ub-incorrect-vtable.rs:10:14 | LL | / const INVALID_VTABLE_ALIGNMENT: &dyn Trait = LL | |     unsafe { std::mem::transmute((&92u8, &[0usize, 1usize, 1000usize])) }; | |______________^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^__- |                | |                invalid vtable: alignment `1000` is not a power of 2 | = note: `#[deny(const_err)]` on by default = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release! = note: for more information, see issue #71800 <https://github.com/rust-lang/rust/issues/71800> error: any use of this value will cause an error --> $DIR/ub-incorrect-vtable.rs:16:14 | LL | / const INVALID_VTABLE_SIZE: &dyn Trait = LL | |     unsafe { std::mem::transmute((&92u8, &[1usize, usize::MAX, 1usize])) }; | |______________^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^__- |                | |                invalid vtable: size is bigger than largest supported object | = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release! = note: for more information, see issue #71800 <https://github.com/rust-lang/rust/issues/71800> error: aborting due to 2 previous errors </ins>
let sz_a = self.a.size(); if A::MAY_HAVE_SIDE_EFFECT && sz_a > self.len { for _ in 0..sz_a - self.len { <ins> self.a_len -= 1; </ins> self.a.next_back(); } <del> self.a_len = self.len; </del> <ins> debug_assert_eq!(self.a_len, self.len); </ins> } let sz_b = self.b.size(); if B::MAY_HAVE_SIDE_EFFECT && sz_b > self.len {
} #[test] <ins> #[cfg(panic = "unwind")] fn test_zip_trusted_random_access_next_back_drop() { use std::panic::catch_unwind; use std::panic::AssertUnwindSafe; let mut counter = 0; let it = [42].iter().map(|e| { let c = counter; counter += 1; if c == 0 { panic!("bomb"); } e }); let it2 = [(); 0].iter(); let mut zip = it.zip(it2); catch_unwind(AssertUnwindSafe(|| { zip.next_back(); })) .unwrap_err(); assert!(zip.next().is_none()); assert_eq!(counter, 1); } #[test] </ins> fn test_double_ended_zip() { let xs = [1, 2, 3, 4, 5, 6]; let ys = [1, 2, 3, 7];
use rustc_span::symbol::{kw, sym, Symbol}; use rustc_span::Span; <del> use crate::clean::{self, Attributes, AttributesExt, FakeDefId, GetDefId, ToSource}; </del> <ins> use crate::clean::{ self, Attributes, AttributesExt, FakeDefId, GetDefId, NestedAttributesExt, ToSource, Type, }; </ins> use crate::core::DocContext; use crate::formats::item_type::ItemType;
if trait_.def_id() == tcx.lang_items().deref_trait() { super::build_deref_target_impls(cx, &trait_items, ret); } <ins> // Return if the trait itself or any types of the generic parameters are doc(hidden). let mut stack: Vec<&Type> = trait_.iter().collect(); stack.push(&for_); while let Some(ty) = stack.pop() { if let Some(did) = ty.def_id() { if cx.tcx.get_attrs(did).lists(sym::doc).has_word(sym::hidden) { return; } } if let Some(generics) = ty.generics() { stack.extend(generics); } } </ins> if let Some(trait_did) = trait_.def_id() { record_extern_trait(cx, trait_did); }
<ins> // Issue #86448: test for cross-crate `doc(hidden)` #![crate_name = "foo"] // aux-build:cross-crate-hidden-impl-parameter.rs extern crate cross_crate_hidden_impl_parameter; pub use ::cross_crate_hidden_impl_parameter::{HiddenType, HiddenTrait}; // OK, not re-exported pub enum MyLibType {} // @!has foo/enum.MyLibType.html '//*[@id="impl-From%3CHiddenType%3E"]' 'impl From<HiddenType> for MyLibType' impl From<HiddenType> for MyLibType { fn from(it: HiddenType) -> MyLibType { match it {} } } pub struct T<T>(T); // @!has foo/enum.MyLibType.html '//*[@id="impl-From%3CT%3CT%3CT%3CT%3CHiddenType%3E%3E%3E%3E%3E"]' 'impl From<T<T<T<T<HiddenType>>>>> for MyLibType' impl From<T<T<T<T<HiddenType>>>>> for MyLibType { fn from(it: T<T<T<T<HiddenType>>>>) -> MyLibType { todo!() } } // @!has foo/enum.MyLibType.html '//*[@id="impl-HiddenTrait"]' 'impl HiddenTrait for MyLibType' impl HiddenTrait for MyLibType {} // @!has foo/struct.T.html '//*[@id="impl-From%3CMyLibType%3E"]' 'impl From<MyLibType> for T<T<T<T<HiddenType>>>>' impl From<MyLibType> for T<T<T<T<HiddenType>>>> { fn from(it: MyLibType) -> T<T<T<T<HiddenType>>>> { match it {} } } </ins>
<ins> // test for `doc(hidden)` with impl parameters in the same crate. #![crate_name = "foo"] #[doc(hidden)] pub enum HiddenType {} #[doc(hidden)] pub trait HiddenTrait {} pub enum MyLibType {} // @!has foo/enum.MyLibType.html '//*[@id="impl-From%3CHiddenType%3E"]' 'impl From<HiddenType> for MyLibType' impl From<HiddenType> for MyLibType { fn from(it: HiddenType) -> MyLibType { match it {} } } pub struct T<T>(T); // @!has foo/enum.MyLibType.html '//*[@id="impl-From%3CT%3CT%3CT%3CT%3CHiddenType%3E%3E%3E%3E%3E"]' 'impl From<T<T<T<T<HiddenType>>>>> for MyLibType' impl From<T<T<T<T<HiddenType>>>>> for MyLibType { fn from(it: T<T<T<T<HiddenType>>>>) -> MyLibType { todo!() } } // @!has foo/enum.MyLibType.html '//*[@id="impl-HiddenTrait"]' 'impl HiddenTrait for MyLibType' impl HiddenTrait for MyLibType {} // @!has foo/struct.T.html '//*[@id="impl-From%3CMyLibType%3E"]' 'impl From<MyLibType> for T<T<T<T<HiddenType>>>>' impl From<MyLibType> for T<T<T<T<HiddenType>>>> { fn from(it: MyLibType) -> T<T<T<T<HiddenType>>>> { match it {} } } </ins>
<ins> #![feature(generic_const_exprs, array_map)] #![allow(incomplete_features)] pub struct ConstCheck<const CHECK: bool>; pub trait True {} impl True for ConstCheck<true> {} pub trait OrdesDec { type Newlen; type Output; fn pop(self) -> (Self::Newlen, Self::Output); } impl<T, const N: usize> OrdesDec for [T; N] where ConstCheck<{N > 1}>: True, [T; N - 1]: Sized, { type Newlen = [T; N - 1]; type Output = T; fn pop(self) -> (Self::Newlen, Self::Output) { let mut iter = IntoIter::new(self); //~^ ERROR: failed to resolve: use of undeclared type `IntoIter` let end = iter.next_back().unwrap(); let new = [(); N - 1].map(move |()| iter.next().unwrap()); (new, end) } } fn main() {} </ins>
<ins> error[E0433]: failed to resolve: use of undeclared type `IntoIter` --> $DIR/issue-82956.rs:25:24 | LL |         let mut iter = IntoIter::new(self); |                        ^^^^^^^^ not found in this scope | help: consider importing one of these items | LL | use std::array::IntoIter; | LL | use std::collections::binary_heap::IntoIter; | LL | use std::collections::btree_map::IntoIter; | LL | use std::collections::btree_set::IntoIter; | and 8 other candidates error: aborting due to previous error For more information about this error, try `rustc --explain E0433`. </ins>