| author | bors <bors@rust-lang.org> 2025-02-08 12:57:59 UTC |
| committer | bors <bors@rust-lang.org> 2025-02-08 12:57:59 UTC |
| log | 8ad2c9724d983cfb116baab0bb800edd17f31644 |
| tree | a54e1d4011f5fdc76090a179cbc965b3c7801dc5 |
| parent | d2f335d58e6c346f94910d0f49baf185028b44be |
| parent | a5b9e8ce837db7312026426c290b2db10248752b |
Rollup of 6 pull requests
Successful merges:
- #136640 (Debuginfo for function ZSTs should have alignment of 8 bits, not 1 bit)
- #136648 (Add a missing `//@ needs-symlink` to `tests/run-make/libs-through-symlinks`)
- #136651 (Label mismatched parameters at the def site for foreign functions)
- #136691 (Remove Linkage::Private and Linkage::Appending)
- #136692 (add module level doc for bootstrap:utils:exec)
- #136700 (i686-unknown-hurd-gnu: bump baseline CPU to Pentium 4)
r? `@ghost`
`@rustbot` modify labels: rollup25 files changed, 70 insertions(+), 51 deletions(-)
compiler/rustc_codegen_gcc/src/base.rs-4| ... | ... | @@ -49,9 +49,7 @@ pub fn global_linkage_to_gcc(linkage: Linkage) -> GlobalKind { |
| 49 | 49 | Linkage::LinkOnceODR => unimplemented!(), |
| 50 | 50 | Linkage::WeakAny => unimplemented!(), |
| 51 | 51 | Linkage::WeakODR => unimplemented!(), |
| 52 | Linkage::Appending => unimplemented!(), | |
| 53 | 52 | Linkage::Internal => GlobalKind::Internal, |
| 54 | Linkage::Private => GlobalKind::Internal, | |
| 55 | 53 | Linkage::ExternalWeak => GlobalKind::Imported, // TODO(antoyo): should be weak linkage. |
| 56 | 54 | Linkage::Common => unimplemented!(), |
| 57 | 55 | } |
| ... | ... | @@ -66,9 +64,7 @@ pub fn linkage_to_gcc(linkage: Linkage) -> FunctionType { |
| 66 | 64 | Linkage::LinkOnceODR => unimplemented!(), |
| 67 | 65 | Linkage::WeakAny => FunctionType::Exported, // FIXME(antoyo): should be similar to linkonce. |
| 68 | 66 | Linkage::WeakODR => unimplemented!(), |
| 69 | Linkage::Appending => unimplemented!(), | |
| 70 | 67 | Linkage::Internal => FunctionType::Internal, |
| 71 | Linkage::Private => FunctionType::Internal, | |
| 72 | 68 | Linkage::ExternalWeak => unimplemented!(), |
| 73 | 69 | Linkage::Common => unimplemented!(), |
| 74 | 70 | } |
compiler/rustc_codegen_gcc/src/mono_item.rs+1-4| ... | ... | @@ -61,10 +61,7 @@ impl<'gcc, 'tcx> PreDefineCodegenMethods<'tcx> for CodegenCx<'gcc, 'tcx> { |
| 61 | 61 | // compiler-rt, then we want to implicitly compile everything with hidden |
| 62 | 62 | // visibility as we're going to link this object all over the place but |
| 63 | 63 | // don't want the symbols to get exported. |
| 64 | if linkage != Linkage::Internal | |
| 65 | && linkage != Linkage::Private | |
| 66 | && self.tcx.is_compiler_builtins(LOCAL_CRATE) | |
| 67 | { | |
| 64 | if linkage != Linkage::Internal && self.tcx.is_compiler_builtins(LOCAL_CRATE) { | |
| 68 | 65 | #[cfg(feature = "master")] |
| 69 | 66 | decl.add_attribute(FnAttribute::Visibility(gccjit::Visibility::Hidden)); |
| 70 | 67 | } else { |
compiler/rustc_codegen_llvm/src/base.rs-2| ... | ... | @@ -157,9 +157,7 @@ pub(crate) fn linkage_to_llvm(linkage: Linkage) -> llvm::Linkage { |
| 157 | 157 | Linkage::LinkOnceODR => llvm::Linkage::LinkOnceODRLinkage, |
| 158 | 158 | Linkage::WeakAny => llvm::Linkage::WeakAnyLinkage, |
| 159 | 159 | Linkage::WeakODR => llvm::Linkage::WeakODRLinkage, |
| 160 | Linkage::Appending => llvm::Linkage::AppendingLinkage, | |
| 161 | 160 | Linkage::Internal => llvm::Linkage::InternalLinkage, |
| 162 | Linkage::Private => llvm::Linkage::PrivateLinkage, | |
| 163 | 161 | Linkage::ExternalWeak => llvm::Linkage::ExternalWeakLinkage, |
| 164 | 162 | Linkage::Common => llvm::Linkage::CommonLinkage, |
| 165 | 163 | } |
compiler/rustc_codegen_llvm/src/debuginfo/metadata.rs+4-7| ... | ... | @@ -319,19 +319,16 @@ fn build_subroutine_type_di_node<'ll, 'tcx>( |
| 319 | 319 | // This is actually a function pointer, so wrap it in pointer DI. |
| 320 | 320 | let name = compute_debuginfo_type_name(cx.tcx, fn_ty, false); |
| 321 | 321 | let (size, align) = match fn_ty.kind() { |
| 322 | ty::FnDef(..) => (0, 1), | |
| 323 | ty::FnPtr(..) => ( | |
| 324 | cx.tcx.data_layout.pointer_size.bits(), | |
| 325 | cx.tcx.data_layout.pointer_align.abi.bits() as u32, | |
| 326 | ), | |
| 322 | ty::FnDef(..) => (Size::ZERO, Align::ONE), | |
| 323 | ty::FnPtr(..) => (cx.tcx.data_layout.pointer_size, cx.tcx.data_layout.pointer_align.abi), | |
| 327 | 324 | _ => unreachable!(), |
| 328 | 325 | }; |
| 329 | 326 | let di_node = unsafe { |
| 330 | 327 | llvm::LLVMRustDIBuilderCreatePointerType( |
| 331 | 328 | DIB(cx), |
| 332 | 329 | fn_di_node, |
| 333 | size, | |
| 334 | align, | |
| 330 | size.bits(), | |
| 331 | align.bits() as u32, | |
| 335 | 332 | 0, // Ignore DWARF address space. |
| 336 | 333 | name.as_c_char_ptr(), |
| 337 | 334 | name.len(), |
compiler/rustc_codegen_llvm/src/debuginfo/mod.rs+1-1| ... | ... | @@ -633,7 +633,7 @@ impl<'ll, 'tcx> DebugInfoCodegenMethods<'tcx> for CodegenCx<'ll, 'tcx> { |
| 633 | 633 | true, |
| 634 | 634 | DIFlags::FlagZero, |
| 635 | 635 | argument_index, |
| 636 | align.bytes() as u32, | |
| 636 | align.bits() as u32, | |
| 637 | 637 | ) |
| 638 | 638 | } |
| 639 | 639 | } |
compiler/rustc_codegen_llvm/src/mono_item.rs+1-4| ... | ... | @@ -71,10 +71,7 @@ impl<'tcx> PreDefineCodegenMethods<'tcx> for CodegenCx<'_, 'tcx> { |
| 71 | 71 | // compiler-rt, then we want to implicitly compile everything with hidden |
| 72 | 72 | // visibility as we're going to link this object all over the place but |
| 73 | 73 | // don't want the symbols to get exported. |
| 74 | if linkage != Linkage::Internal | |
| 75 | && linkage != Linkage::Private | |
| 76 | && self.tcx.is_compiler_builtins(LOCAL_CRATE) | |
| 77 | { | |
| 74 | if linkage != Linkage::Internal && self.tcx.is_compiler_builtins(LOCAL_CRATE) { | |
| 78 | 75 | llvm::set_visibility(lldecl, llvm::Visibility::Hidden); |
| 79 | 76 | } else { |
| 80 | 77 | llvm::set_visibility(lldecl, base::visibility_to_llvm(visibility)); |
compiler/rustc_codegen_ssa/src/codegen_attrs.rs-2| ... | ... | @@ -41,7 +41,6 @@ fn linkage_by_name(tcx: TyCtxt<'_>, def_id: LocalDefId, name: &str) -> Linkage { |
| 41 | 41 | // ghost, dllimport, dllexport and linkonce_odr_autohide are not supported |
| 42 | 42 | // and don't have to be, LLVM treats them as no-ops. |
| 43 | 43 | match name { |
| 44 | "appending" => Appending, | |
| 45 | 44 | "available_externally" => AvailableExternally, |
| 46 | 45 | "common" => Common, |
| 47 | 46 | "extern_weak" => ExternalWeak, |
| ... | ... | @@ -49,7 +48,6 @@ fn linkage_by_name(tcx: TyCtxt<'_>, def_id: LocalDefId, name: &str) -> Linkage { |
| 49 | 48 | "internal" => Internal, |
| 50 | 49 | "linkonce" => LinkOnceAny, |
| 51 | 50 | "linkonce_odr" => LinkOnceODR, |
| 52 | "private" => Private, | |
| 53 | 51 | "weak" => WeakAny, |
| 54 | 52 | "weak_odr" => WeakODR, |
| 55 | 53 | _ => tcx.dcx().span_fatal(tcx.def_span(def_id), "invalid linkage specified"), |
compiler/rustc_codegen_ssa/src/mir/naked_asm.rs+1-2| ... | ... | @@ -187,10 +187,9 @@ fn prefix_and_suffix<'tcx>( |
| 187 | 187 | } |
| 188 | 188 | } |
| 189 | 189 | } |
| 190 | Linkage::Internal | Linkage::Private => { | |
| 190 | Linkage::Internal => { | |
| 191 | 191 | // write nothing |
| 192 | 192 | } |
| 193 | Linkage::Appending => emit_fatal("Only global variables can have appending linkage!"), | |
| 194 | 193 | Linkage::Common => emit_fatal("Functions may not have common linkage"), |
| 195 | 194 | Linkage::AvailableExternally => { |
| 196 | 195 | // this would make the function equal an extern definition |
compiler/rustc_hir_typeck/src/fn_ctxt/checks.rs+9-3| ... | ... | @@ -2641,8 +2641,9 @@ impl<'a, 'tcx> FnCtxt<'a, 'tcx> { |
| 2641 | 2641 | } |
| 2642 | 2642 | |
| 2643 | 2643 | /// Returns the parameters of a function, with their generic parameters if those are the full |
| 2644 | /// type of that parameter. Returns `None` if the function has no generics or the body is | |
| 2645 | /// unavailable (eg is an instrinsic). | |
| 2644 | /// type of that parameter. | |
| 2645 | /// | |
| 2646 | /// Returns `None` if the body is not a named function (e.g. a closure). | |
| 2646 | 2647 | fn get_hir_param_info( |
| 2647 | 2648 | &self, |
| 2648 | 2649 | def_id: DefId, |
| ... | ... | @@ -2667,6 +2668,10 @@ impl<'a, 'tcx> FnCtxt<'a, 'tcx> { |
| 2667 | 2668 | kind: hir::ItemKind::Fn { sig, generics, body, .. }, |
| 2668 | 2669 | .. |
| 2669 | 2670 | }) => (sig, generics, Some(body), None), |
| 2671 | hir::Node::ForeignItem(&hir::ForeignItem { | |
| 2672 | kind: hir::ForeignItemKind::Fn(sig, params, generics), | |
| 2673 | .. | |
| 2674 | }) => (sig, generics, None, Some(params)), | |
| 2670 | 2675 | _ => return None, |
| 2671 | 2676 | }; |
| 2672 | 2677 | |
| ... | ... | @@ -2700,7 +2705,8 @@ impl<'a, 'tcx> FnCtxt<'a, 'tcx> { |
| 2700 | 2705 | )) |
| 2701 | 2706 | } |
| 2702 | 2707 | (None, Some(params)) => { |
| 2703 | let params = params.get(is_method as usize..)?; | |
| 2708 | let params = | |
| 2709 | params.get(is_method as usize..params.len() - sig.decl.c_variadic as usize)?; | |
| 2704 | 2710 | debug_assert_eq!(params.len(), fn_inputs.len()); |
| 2705 | 2711 | Some(( |
| 2706 | 2712 | fn_inputs.zip(params.iter().map(|param| FnParam::Name(param))).collect(), |
compiler/rustc_middle/src/middle/codegen_fn_attrs.rs+1-1| ... | ... | @@ -178,7 +178,7 @@ impl CodegenFnAttrs { |
| 178 | 178 | || match self.linkage { |
| 179 | 179 | // These are private, so make sure we don't try to consider |
| 180 | 180 | // them external. |
| 181 | None | Some(Linkage::Internal | Linkage::Private) => false, | |
| 181 | None | Some(Linkage::Internal) => false, | |
| 182 | 182 | Some(_) => true, |
| 183 | 183 | } |
| 184 | 184 | } |
compiler/rustc_middle/src/mir/mono.rs-2| ... | ... | @@ -327,9 +327,7 @@ pub enum Linkage { |
| 327 | 327 | LinkOnceODR, |
| 328 | 328 | WeakAny, |
| 329 | 329 | WeakODR, |
| 330 | Appending, | |
| 331 | 330 | Internal, |
| 332 | Private, | |
| 333 | 331 | ExternalWeak, |
| 334 | 332 | Common, |
| 335 | 333 | } |
compiler/rustc_monomorphize/src/partitioning.rs-2| ... | ... | @@ -1238,9 +1238,7 @@ fn collect_and_partition_mono_items(tcx: TyCtxt<'_>, (): ()) -> MonoItemPartitio |
| 1238 | 1238 | Linkage::LinkOnceODR => "OnceODR", |
| 1239 | 1239 | Linkage::WeakAny => "WeakAny", |
| 1240 | 1240 | Linkage::WeakODR => "WeakODR", |
| 1241 | Linkage::Appending => "Appending", | |
| 1242 | 1241 | Linkage::Internal => "Internal", |
| 1243 | Linkage::Private => "Private", | |
| 1244 | 1242 | Linkage::ExternalWeak => "ExternalWeak", |
| 1245 | 1243 | Linkage::Common => "Common", |
| 1246 | 1244 | }; |
compiler/rustc_target/src/spec/targets/i686_unknown_hurd_gnu.rs+1-1| ... | ... | @@ -2,7 +2,7 @@ use crate::spec::{Cc, LinkerFlavor, Lld, StackProbeType, Target, base}; |
| 2 | 2 | |
| 3 | 3 | pub(crate) fn target() -> Target { |
| 4 | 4 | let mut base = base::hurd_gnu::opts(); |
| 5 | base.cpu = "pentiumpro".into(); | |
| 5 | base.cpu = "pentium4".into(); | |
| 6 | 6 | base.max_atomic_width = Some(64); |
| 7 | 7 | base.add_pre_link_args(LinkerFlavor::Gnu(Cc::Yes, Lld::No), &["-m32"]); |
| 8 | 8 | base.stack_probes = StackProbeType::Inline; |
src/bootstrap/src/utils/exec.rs+5| ... | ... | @@ -1,3 +1,8 @@ |
| 1 | //! Command Execution Module | |
| 2 | //! | |
| 3 | //! This module provides a structured way to execute and manage commands efficiently, | |
| 4 | //! ensuring controlled failure handling and output management. | |
| 5 | ||
| 1 | 6 | use std::ffi::OsStr; |
| 2 | 7 | use std::fmt::{Debug, Formatter}; |
| 3 | 8 | use std::path::Path; |
src/doc/rustc/src/platform-support.md+1-1| ... | ... | @@ -312,7 +312,7 @@ target | std | host | notes |
| 312 | 312 | [`i586-unknown-netbsd`](platform-support/netbsd.md) | ✓ | | 32-bit x86 (original Pentium) [^x86_32-floats-x87] |
| 313 | 313 | [`i686-apple-darwin`](platform-support/apple-darwin.md) | ✓ | ✓ | 32-bit macOS (10.12+, Sierra+, Penryn) [^x86_32-floats-return-ABI] |
| 314 | 314 | `i686-unknown-haiku` | ✓ | ✓ | 32-bit Haiku (Pentium 4) [^x86_32-floats-return-ABI] |
| 315 | [`i686-unknown-hurd-gnu`](platform-support/hurd.md) | ✓ | ✓ | 32-bit GNU/Hurd (PentiumPro) [^x86_32-floats-x87] | |
| 315 | [`i686-unknown-hurd-gnu`](platform-support/hurd.md) | ✓ | ✓ | 32-bit GNU/Hurd (Pentium 4) [^x86_32-floats-x87] | |
| 316 | 316 | [`i686-unknown-netbsd`](platform-support/netbsd.md) | ✓ | ✓ | NetBSD/i386 (Pentium 4) [^x86_32-floats-return-ABI] |
| 317 | 317 | [`i686-unknown-openbsd`](platform-support/openbsd.md) | ✓ | ✓ | 32-bit OpenBSD (Pentium 4) [^x86_32-floats-return-ABI] |
| 318 | 318 | [`i686-unknown-redox`](platform-support/redox.md) | ✓ | | i686 Redox OS (PentiumPro) [^x86_32-floats-x87] |
tests/codegen/debug-fndef-size.rs+5-3| ... | ... | @@ -1,4 +1,6 @@ |
| 1 | // Verify that `i32::cmp` FnDef type is declared with size 0 and align 1 in LLVM debuginfo. | |
| 1 | // Verify that `i32::cmp` FnDef type is declared with a size of 0 and an | |
| 2 | // alignment of 8 bits (1 byte) in LLVM debuginfo. | |
| 3 | ||
| 2 | 4 | //@ compile-flags: -O -g -Cno-prepopulate-passes |
| 3 | 5 | //@ ignore-msvc the types are mangled differently |
| 4 | 6 | |
| ... | ... | @@ -14,5 +16,5 @@ pub fn main() { |
| 14 | 16 | |
| 15 | 17 | // CHECK: %compare.dbg.spill = alloca [0 x i8], align 1 |
| 16 | 18 | // CHECK: dbg{{.}}declare({{(metadata )?}}ptr %compare.dbg.spill, {{(metadata )?}}![[VAR:.*]], {{(metadata )?}}!DIExpression() |
| 17 | // CHECK: ![[TYPE:.*]] = !DIDerivedType(tag: DW_TAG_pointer_type, name: "fn(&i32, &i32) -> core::cmp::Ordering", baseType: !{{.*}}, align: 1, dwarfAddressSpace: {{.*}}) | |
| 18 | // CHECK: ![[VAR]] = !DILocalVariable(name: "compare", scope: !{{.*}}, file: !{{.*}}, line: {{.*}}, type: ![[TYPE]], align: 1) | |
| 19 | // CHECK: ![[TYPE:.*]] = !DIDerivedType(tag: DW_TAG_pointer_type, name: "fn(&i32, &i32) -> core::cmp::Ordering", baseType: !{{.*}}, align: 8, dwarfAddressSpace: {{.*}}) | |
| 20 | // CHECK: ![[VAR]] = !DILocalVariable(name: "compare", scope: !{{.*}}, file: !{{.*}}, line: {{.*}}, type: ![[TYPE]], align: 8) |
tests/run-make/libs-through-symlinks/rmake.rs+1| ... | ... | @@ -21,6 +21,7 @@ |
| 21 | 21 | //! <https://github.com/rust-lang/rust/pull/13903>. |
| 22 | 22 | |
| 23 | 23 | //@ ignore-cross-compile |
| 24 | //@ needs-symlink | |
| 24 | 25 | |
| 25 | 26 | use run_make_support::{bare_rustc, cwd, path, rfs, rust_lib_name}; |
| 26 | 27 |
tests/ui/argument-suggestions/extern-fn-arg-names.stderr+1-1| ... | ... | @@ -14,7 +14,7 @@ note: function defined here |
| 14 | 14 | --> $DIR/extern-fn-arg-names.rs:2:8 |
| 15 | 15 | | |
| 16 | 16 | LL | fn dstfn(src: i32, dst: err); |
| 17 | | ^^^^^ | |
| 17 | | ^^^^^ --- | |
| 18 | 18 | help: provide the argument |
| 19 | 19 | | |
| 20 | 20 | LL | dstfn(1, /* dst */); |
tests/ui/c-variadic/variadic-ffi-1.stderr+2-2| ... | ... | @@ -14,7 +14,7 @@ note: function defined here |
| 14 | 14 | --> $DIR/variadic-ffi-1.rs:15:8 |
| 15 | 15 | | |
| 16 | 16 | LL | fn foo(f: isize, x: u8, ...); |
| 17 | | ^^^ | |
| 17 | | ^^^ - - | |
| 18 | 18 | help: provide the arguments |
| 19 | 19 | | |
| 20 | 20 | LL | foo(/* isize */, /* u8 */); |
| ... | ... | @@ -30,7 +30,7 @@ note: function defined here |
| 30 | 30 | --> $DIR/variadic-ffi-1.rs:15:8 |
| 31 | 31 | | |
| 32 | 32 | LL | fn foo(f: isize, x: u8, ...); |
| 33 | | ^^^ | |
| 33 | | ^^^ - | |
| 34 | 34 | help: provide the argument |
| 35 | 35 | | |
| 36 | 36 | LL | foo(1, /* u8 */); |
tests/ui/error-codes/E0060.stderr+1-1| ... | ... | @@ -8,7 +8,7 @@ note: function defined here |
| 8 | 8 | --> $DIR/E0060.rs:2:8 |
| 9 | 9 | | |
| 10 | 10 | LL | fn printf(_: *const u8, ...) -> u32; |
| 11 | | ^^^^^^ | |
| 11 | | ^^^^^^ - | |
| 12 | 12 | help: provide the argument |
| 13 | 13 | | |
| 14 | 14 | LL | unsafe { printf(/* *const u8 */); } |
tests/ui/fn/param-mismatch-foreign.rs created+11| ... | ... | @@ -0,0 +1,11 @@ |
| 1 | extern "C" { | |
| 2 | fn foo(x: i32, y: u32, z: i32); | |
| 3 | //~^ NOTE function defined here | |
| 4 | } | |
| 5 | ||
| 6 | fn main() { | |
| 7 | foo(1i32, 2i32); | |
| 8 | //~^ ERROR this function takes 3 arguments but 2 arguments were supplied | |
| 9 | //~| NOTE argument #2 of type `u32` is missing | |
| 10 | //~| HELP provide the argument | |
| 11 | } |
tests/ui/fn/param-mismatch-foreign.stderr created+19| ... | ... | @@ -0,0 +1,19 @@ |
| 1 | error[E0061]: this function takes 3 arguments but 2 arguments were supplied | |
| 2 | --> $DIR/param-mismatch-foreign.rs:7:5 | |
| 3 | | | |
| 4 | LL | foo(1i32, 2i32); | |
| 5 | | ^^^ ---- argument #2 of type `u32` is missing | |
| 6 | | | |
| 7 | note: function defined here | |
| 8 | --> $DIR/param-mismatch-foreign.rs:2:8 | |
| 9 | | | |
| 10 | LL | fn foo(x: i32, y: u32, z: i32); | |
| 11 | | ^^^ - | |
| 12 | help: provide the argument | |
| 13 | | | |
| 14 | LL | foo(1i32, /* u32 */, 2i32); | |
| 15 | | ~~~~~~~~~~~~~~~~~~~~~~~ | |
| 16 | ||
| 17 | error: aborting due to 1 previous error | |
| 18 | ||
| 19 | For more information about this error, try `rustc --explain E0061`. |
tests/ui/linkage-attr/linkage-attr-does-not-panic-llvm-issue-33992.rs-3| ... | ... | @@ -18,9 +18,6 @@ pub static TEST4: bool = true; |
| 18 | 18 | #[linkage = "linkonce_odr"] |
| 19 | 19 | pub static TEST5: bool = true; |
| 20 | 20 | |
| 21 | #[linkage = "private"] | |
| 22 | pub static TEST6: bool = true; | |
| 23 | ||
| 24 | 21 | #[linkage = "weak"] |
| 25 | 22 | pub static TEST7: bool = true; |
| 26 | 23 |
tests/ui/mismatched_types/issue-26480.stderr+1-1| ... | ... | @@ -13,7 +13,7 @@ note: function defined here |
| 13 | 13 | --> $DIR/issue-26480.rs:2:8 |
| 14 | 14 | | |
| 15 | 15 | LL | fn write(fildes: i32, buf: *const i8, nbyte: u64) -> i64; |
| 16 | | ^^^^^ | |
| 16 | | ^^^^^ ----- | |
| 17 | 17 | = note: this error originates in the macro `write` (in Nightly builds, run with -Z macro-backtrace for more info) |
| 18 | 18 | help: you can convert a `usize` to a `u64` and panic if the converted value doesn't fit |
| 19 | 19 | | |
tests/ui/suggestions/suggest-null-ptr.stderr+4-4| ... | ... | @@ -12,7 +12,7 @@ note: function defined here |
| 12 | 12 | --> $DIR/suggest-null-ptr.rs:7:8 |
| 13 | 13 | | |
| 14 | 14 | LL | fn foo(ptr: *const u8); |
| 15 | | ^^^ | |
| 15 | | ^^^ --- | |
| 16 | 16 | help: if you meant to create a null pointer, use `std::ptr::null()` |
| 17 | 17 | | |
| 18 | 18 | LL | foo(std::ptr::null()); |
| ... | ... | @@ -32,7 +32,7 @@ note: function defined here |
| 32 | 32 | --> $DIR/suggest-null-ptr.rs:9:8 |
| 33 | 33 | | |
| 34 | 34 | LL | fn foo_mut(ptr: *mut u8); |
| 35 | | ^^^^^^^ | |
| 35 | | ^^^^^^^ --- | |
| 36 | 36 | help: if you meant to create a null pointer, use `std::ptr::null_mut()` |
| 37 | 37 | | |
| 38 | 38 | LL | foo_mut(std::ptr::null_mut()); |
| ... | ... | @@ -52,7 +52,7 @@ note: function defined here |
| 52 | 52 | --> $DIR/suggest-null-ptr.rs:11:8 |
| 53 | 53 | | |
| 54 | 54 | LL | fn usize(ptr: *const usize); |
| 55 | | ^^^^^ | |
| 55 | | ^^^^^ --- | |
| 56 | 56 | help: if you meant to create a null pointer, use `std::ptr::null()` |
| 57 | 57 | | |
| 58 | 58 | LL | usize(std::ptr::null()); |
| ... | ... | @@ -72,7 +72,7 @@ note: function defined here |
| 72 | 72 | --> $DIR/suggest-null-ptr.rs:13:8 |
| 73 | 73 | | |
| 74 | 74 | LL | fn usize_mut(ptr: *mut usize); |
| 75 | | ^^^^^^^^^ | |
| 75 | | ^^^^^^^^^ --- | |
| 76 | 76 | help: if you meant to create a null pointer, use `std::ptr::null_mut()` |
| 77 | 77 | | |
| 78 | 78 | LL | usize_mut(std::ptr::null_mut()); |