From 72ba0ba3d7ce8a5d34bbffaca4be5da5b988499f Mon Sep 17 00:00:00 2001 From: Guillaume Gomez Date: Wed, 5 Sep 2018 23:54:07 +0200 Subject: Replace unwrap calls in example by expect --- src/libstd/ffi/c_str.rs | 64 ++++++++++++++++++++++++++----------------------- 1 file changed, 34 insertions(+), 30 deletions(-) (limited to 'src/libstd') diff --git a/src/libstd/ffi/c_str.rs b/src/libstd/ffi/c_str.rs index 2b87094926c..d9d9e9476b9 100644 --- a/src/libstd/ffi/c_str.rs +++ b/src/libstd/ffi/c_str.rs @@ -101,8 +101,8 @@ use sys; /// } /// /// // We are certain that our string doesn't have 0 bytes in the middle, -/// // so we can .unwrap() -/// let c_to_print = CString::new("Hello, world!").unwrap(); +/// // so we can .expect() +/// let c_to_print = CString::new("Hello, world!").expect("CString::new failed"); /// unsafe { /// my_printer(c_to_print.as_ptr()); /// } @@ -174,7 +174,7 @@ pub struct CString { /// unsafe { work_with(data.as_ptr()) } /// } /// -/// let s = CString::new("data data data data").unwrap(); +/// let s = CString::new("data data data data").expect("CString::new failed"); /// work(&s); /// ``` /// @@ -313,7 +313,7 @@ impl CString { /// /// extern { fn puts(s: *const c_char); } /// - /// let to_print = CString::new("Hello!").unwrap(); + /// let to_print = CString::new("Hello!").expect("CString::new failed"); /// unsafe { /// puts(to_print.as_ptr()); /// } @@ -397,7 +397,7 @@ impl CString { /// fn some_extern_function(s: *mut c_char); /// } /// - /// let c_string = CString::new("Hello!").unwrap(); + /// let c_string = CString::new("Hello!").expect("CString::new failed"); /// let raw = c_string.into_raw(); /// unsafe { /// some_extern_function(raw); @@ -427,7 +427,7 @@ impl CString { /// ``` /// use std::ffi::CString; /// - /// let c_string = CString::new("foo").unwrap(); + /// let c_string = CString::new("foo").expect("CString::new failed"); /// /// let ptr = c_string.into_raw(); /// @@ -459,12 +459,12 @@ impl CString { /// use std::ffi::CString; /// /// let valid_utf8 = vec![b'f', b'o', b'o']; - /// let cstring = CString::new(valid_utf8).unwrap(); - /// assert_eq!(cstring.into_string().unwrap(), "foo"); + /// let cstring = CString::new(valid_utf8).expect("CString::new failed"); + /// assert_eq!(cstring.into_string().expect("into_string() call failed"), "foo"); /// /// let invalid_utf8 = vec![b'f', 0xff, b'o', b'o']; - /// let cstring = CString::new(invalid_utf8).unwrap(); - /// let err = cstring.into_string().err().unwrap(); + /// let cstring = CString::new(invalid_utf8).expect("CString::new failed"); + /// let err = cstring.into_string().err().expect("into_string().err() failed"); /// assert_eq!(err.utf8_error().valid_up_to(), 1); /// ``` @@ -488,7 +488,7 @@ impl CString { /// ``` /// use std::ffi::CString; /// - /// let c_string = CString::new("foo").unwrap(); + /// let c_string = CString::new("foo").expect("CString::new failed"); /// let bytes = c_string.into_bytes(); /// assert_eq!(bytes, vec![b'f', b'o', b'o']); /// ``` @@ -510,7 +510,7 @@ impl CString { /// ``` /// use std::ffi::CString; /// - /// let c_string = CString::new("foo").unwrap(); + /// let c_string = CString::new("foo").expect("CString::new failed"); /// let bytes = c_string.into_bytes_with_nul(); /// assert_eq!(bytes, vec![b'f', b'o', b'o', b'\0']); /// ``` @@ -533,7 +533,7 @@ impl CString { /// ``` /// use std::ffi::CString; /// - /// let c_string = CString::new("foo").unwrap(); + /// let c_string = CString::new("foo").expect("CString::new failed"); /// let bytes = c_string.as_bytes(); /// assert_eq!(bytes, &[b'f', b'o', b'o']); /// ``` @@ -553,7 +553,7 @@ impl CString { /// ``` /// use std::ffi::CString; /// - /// let c_string = CString::new("foo").unwrap(); + /// let c_string = CString::new("foo").expect("CString::new failed"); /// let bytes = c_string.as_bytes_with_nul(); /// assert_eq!(bytes, &[b'f', b'o', b'o', b'\0']); /// ``` @@ -572,9 +572,10 @@ impl CString { /// ``` /// use std::ffi::{CString, CStr}; /// - /// let c_string = CString::new(b"foo".to_vec()).unwrap(); + /// let c_string = CString::new(b"foo".to_vec()).expect("CString::new failed"); /// let c_str = c_string.as_c_str(); - /// assert_eq!(c_str, CStr::from_bytes_with_nul(b"foo\0").unwrap()); + /// assert_eq!(c_str, + /// CStr::from_bytes_with_nul(b"foo\0").expect("CStr::from_bytes_with_nul failed")); /// ``` #[inline] #[stable(feature = "as_c_str", since = "1.20.0")] @@ -591,16 +592,17 @@ impl CString { /// ``` /// use std::ffi::{CString, CStr}; /// - /// let c_string = CString::new(b"foo".to_vec()).unwrap(); + /// let c_string = CString::new(b"foo".to_vec()).expect("CString::new failed"); /// let boxed = c_string.into_boxed_c_str(); - /// assert_eq!(&*boxed, CStr::from_bytes_with_nul(b"foo\0").unwrap()); + /// assert_eq!(&*boxed, + /// CStr::from_bytes_with_nul(b"foo\0").expect("CStr::from_bytes_with_nul failed")); /// ``` #[stable(feature = "into_boxed_c_str", since = "1.20.0")] pub fn into_boxed_c_str(self) -> Box { unsafe { Box::from_raw(Box::into_raw(self.into_inner()) as *mut CStr) } } - // Bypass "move out of struct which implements [`Drop`] trait" restriction. + /// Bypass "move out of struct which implements [`Drop`] trait" restriction. /// /// [`Drop`]: ../ops/trait.Drop.html fn into_inner(self) -> Box<[u8]> { @@ -1030,7 +1032,7 @@ impl CStr { /// use std::ffi::{CStr, CString}; /// /// unsafe { - /// let cstring = CString::new("hello").unwrap(); + /// let cstring = CString::new("hello").expect("CString::new failed"); /// let cstr = CStr::from_bytes_with_nul_unchecked(cstring.to_bytes_with_nul()); /// assert_eq!(cstr, &*cstring); /// } @@ -1057,7 +1059,7 @@ impl CStr { /// # #![allow(unused_must_use)] /// use std::ffi::{CString}; /// - /// let ptr = CString::new("Hello").unwrap().as_ptr(); + /// let ptr = CString::new("Hello").expect("CString::new failed").as_ptr(); /// unsafe { /// // `ptr` is dangling /// *ptr; @@ -1066,14 +1068,14 @@ impl CStr { /// /// This happens because the pointer returned by `as_ptr` does not carry any /// lifetime information and the [`CString`] is deallocated immediately after - /// the `CString::new("Hello").unwrap().as_ptr()` expression is evaluated. + /// the `CString::new("Hello").expect("CString::new failed").as_ptr()` expression is evaluated. /// To fix the problem, bind the `CString` to a local variable: /// /// ```no_run /// # #![allow(unused_must_use)] /// use std::ffi::{CString}; /// - /// let hello = CString::new("Hello").unwrap(); + /// let hello = CString::new("Hello").expect("CString::new failed"); /// let ptr = hello.as_ptr(); /// unsafe { /// // `ptr` is valid because `hello` is in scope @@ -1105,7 +1107,7 @@ impl CStr { /// ``` /// use std::ffi::CStr; /// - /// let c_str = CStr::from_bytes_with_nul(b"foo\0").unwrap(); + /// let c_str = CStr::from_bytes_with_nul(b"foo\0").expect("CStr::from_bytes_with_nul failed"); /// assert_eq!(c_str.to_bytes(), b"foo"); /// ``` #[inline] @@ -1131,7 +1133,7 @@ impl CStr { /// ``` /// use std::ffi::CStr; /// - /// let c_str = CStr::from_bytes_with_nul(b"foo\0").unwrap(); + /// let c_str = CStr::from_bytes_with_nul(b"foo\0").expect("CStr::from_bytes_with_nul failed"); /// assert_eq!(c_str.to_bytes_with_nul(), b"foo\0"); /// ``` #[inline] @@ -1158,7 +1160,7 @@ impl CStr { /// ``` /// use std::ffi::CStr; /// - /// let c_str = CStr::from_bytes_with_nul(b"foo\0").unwrap(); + /// let c_str = CStr::from_bytes_with_nul(b"foo\0").expect("CStr::from_bytes_with_nul failed"); /// assert_eq!(c_str.to_str(), Ok("foo")); /// ``` #[stable(feature = "cstr_to_str", since = "1.4.0")] @@ -1199,7 +1201,8 @@ impl CStr { /// use std::borrow::Cow; /// use std::ffi::CStr; /// - /// let c_str = CStr::from_bytes_with_nul(b"Hello World\0").unwrap(); + /// let c_str = CStr::from_bytes_with_nul(b"Hello World\0") + /// .expect("CStr::from_bytes_with_nul failed"); /// assert_eq!(c_str.to_string_lossy(), Cow::Borrowed("Hello World")); /// ``` /// @@ -1209,7 +1212,8 @@ impl CStr { /// use std::borrow::Cow; /// use std::ffi::CStr; /// - /// let c_str = CStr::from_bytes_with_nul(b"Hello \xF0\x90\x80World\0").unwrap(); + /// let c_str = CStr::from_bytes_with_nul(b"Hello \xF0\x90\x80World\0") + /// .expect("CStr::from_bytes_with_nul failed"); /// assert_eq!( /// c_str.to_string_lossy(), /// Cow::Owned(String::from("Hello �World")) as Cow @@ -1230,9 +1234,9 @@ impl CStr { /// ``` /// use std::ffi::CString; /// - /// let c_string = CString::new(b"foo".to_vec()).unwrap(); + /// let c_string = CString::new(b"foo".to_vec()).expect("CString::new failed"); /// let boxed = c_string.into_boxed_c_str(); - /// assert_eq!(boxed.into_c_string(), CString::new("foo").unwrap()); + /// assert_eq!(boxed.into_c_string(), CString::new("foo").expect("CString::new failed")); /// ``` #[stable(feature = "into_boxed_c_str", since = "1.20.0")] pub fn into_c_string(self: Box) -> CString { -- cgit 1.4.1-3-g733a5 From 5595aeb6b7eda6b96cb2fe882401213c4fc04c6f Mon Sep 17 00:00:00 2001 From: Alex Crichton Date: Thu, 30 Aug 2018 10:25:07 -0700 Subject: Add rustc SHA to released DWARF debuginfo This commit updates the debuginfo that is encoded in all of our released artifacts by default. Currently it has paths like `/checkout/src/...` but these are a little inconsistent and have changed over time. This commit instead attempts to actually define the file paths in our debuginfo to be consistent between releases. All debuginfo paths are now intended to be `/rustc/$sha` where `$sha` is the git sha of the released compiler. Sub-paths are all paths into the git repo at that `$sha`. --- config.toml.example | 4 +++ src/bootstrap/bin/rustc.rs | 4 +++ src/bootstrap/builder.rs | 8 ++++-- src/bootstrap/cc_detect.rs | 4 +-- src/bootstrap/compile.rs | 4 +-- src/bootstrap/config.rs | 3 ++ src/bootstrap/lib.rs | 32 +++++++++++++++++++++- src/bootstrap/native.rs | 7 +++-- src/bootstrap/test.rs | 4 +-- src/ci/run.sh | 1 + src/libstd/build.rs | 4 +++ src/test/ui/consts/const-size_of-cycle.rs | 2 ++ src/test/ui/impl-trait/impl-generic-mismatch.rs | 3 ++ .../ui/impl-trait/impl-generic-mismatch.stderr | 6 ++-- 14 files changed, 71 insertions(+), 15 deletions(-) (limited to 'src/libstd') diff --git a/config.toml.example b/config.toml.example index 35f69cd05b6..d569bede0e1 100644 --- a/config.toml.example +++ b/config.toml.example @@ -373,6 +373,10 @@ # Whether to verify generated LLVM IR #verify-llvm-ir = false +# Map all debuginfo paths for libstd and crates to `/rust/$sha/$crate/...`, +# generally only set for releases +#remap-debuginfo = false + # ============================================================================= # Options for specific targets # diff --git a/src/bootstrap/bin/rustc.rs b/src/bootstrap/bin/rustc.rs index 7192cae8956..f30f34acf5c 100644 --- a/src/bootstrap/bin/rustc.rs +++ b/src/bootstrap/bin/rustc.rs @@ -263,6 +263,10 @@ fn main() { if env::var_os("RUSTC_FORCE_UNSTABLE").is_some() { cmd.arg("-Z").arg("force-unstable-if-unmarked"); } + + if let Ok(map) = env::var("RUSTC_DEBUGINFO_MAP") { + cmd.arg("--remap-path-prefix").arg(&map); + } } else { // Override linker if necessary. if let Ok(host_linker) = env::var("RUSTC_HOST_LINKER") { diff --git a/src/bootstrap/builder.rs b/src/bootstrap/builder.rs index 5c287f25e26..2f7f3058b04 100644 --- a/src/bootstrap/builder.rs +++ b/src/bootstrap/builder.rs @@ -32,7 +32,7 @@ use native; use test; use tool; use util::{add_lib_path, exe, libdir}; -use {Build, DocTests, Mode}; +use {Build, DocTests, Mode, GitRepo}; pub use Compiler; @@ -876,6 +876,10 @@ impl<'a> Builder<'a> { cargo.env("RUSTC_HOST_CRT_STATIC", x.to_string()); } + if let Some(map) = self.build.debuginfo_map(GitRepo::Rustc) { + cargo.env("RUSTC_DEBUGINFO_MAP", map); + } + // Enable usage of unstable features cargo.env("RUSTC_BOOTSTRAP", "1"); self.add_rust_test_threads(&mut cargo); @@ -964,7 +968,7 @@ impl<'a> Builder<'a> { let cc = ccacheify(&self.cc(target)); cargo.env(format!("CC_{}", target), &cc).env("CC", &cc); - let cflags = self.cflags(target).join(" "); + let cflags = self.cflags(target, GitRepo::Rustc).join(" "); cargo .env(format!("CFLAGS_{}", target), cflags.clone()) .env("CFLAGS", cflags.clone()); diff --git a/src/bootstrap/cc_detect.rs b/src/bootstrap/cc_detect.rs index 698903f128d..d5da0cabec8 100644 --- a/src/bootstrap/cc_detect.rs +++ b/src/bootstrap/cc_detect.rs @@ -39,7 +39,7 @@ use std::process::Command; use build_helper::output; use cc; -use Build; +use {Build, GitRepo}; use config::Target; use cache::Interned; @@ -107,7 +107,7 @@ pub fn find(build: &mut Build) { build.cc.insert(target, compiler); build.verbose(&format!("CC_{} = {:?}", &target, build.cc(target))); - build.verbose(&format!("CFLAGS_{} = {:?}", &target, build.cflags(target))); + build.verbose(&format!("CFLAGS_{} = {:?}", &target, build.cflags(target, GitRepo::Rustc))); if let Some(ar) = ar { build.verbose(&format!("AR_{} = {:?}", &target, ar)); build.ar.insert(target, ar); diff --git a/src/bootstrap/compile.rs b/src/bootstrap/compile.rs index da0ccf5e177..c0661a773e3 100644 --- a/src/bootstrap/compile.rs +++ b/src/bootstrap/compile.rs @@ -30,7 +30,7 @@ use filetime::FileTime; use serde_json; use util::{exe, libdir, is_dylib, CiEnv}; -use {Compiler, Mode}; +use {Compiler, Mode, GitRepo}; use native; use tool; @@ -895,7 +895,7 @@ pub fn compiler_file(builder: &Builder, target: Interned, file: &str) -> PathBuf { let mut cmd = Command::new(compiler); - cmd.args(builder.cflags(target)); + cmd.args(builder.cflags(target, GitRepo::Rustc)); cmd.arg(format!("-print-file-name={}", file)); let out = output(&mut cmd); PathBuf::from(out.trim()) diff --git a/src/bootstrap/config.rs b/src/bootstrap/config.rs index bf4d39c4947..872ff132a69 100644 --- a/src/bootstrap/config.rs +++ b/src/bootstrap/config.rs @@ -108,6 +108,7 @@ pub struct Config { pub rust_codegen_backends: Vec>, pub rust_codegen_backends_dir: String, pub rust_verify_llvm_ir: bool, + pub rust_remap_debuginfo: bool, pub build: Interned, pub hosts: Vec>, @@ -319,6 +320,7 @@ struct Rust { deny_warnings: Option, backtrace_on_ice: Option, verify_llvm_ir: Option, + remap_debuginfo: Option, } /// TOML representation of how each build target is configured. @@ -554,6 +556,7 @@ impl Config { set(&mut config.deny_warnings, rust.deny_warnings.or(flags.warnings)); set(&mut config.backtrace_on_ice, rust.backtrace_on_ice); set(&mut config.rust_verify_llvm_ir, rust.verify_llvm_ir); + set(&mut config.rust_remap_debuginfo, rust.remap_debuginfo); if let Some(ref backends) = rust.codegen_backends { config.rust_codegen_backends = backends.iter() diff --git a/src/bootstrap/lib.rs b/src/bootstrap/lib.rs index 2725abdc3d9..ed6a5f94d0d 100644 --- a/src/bootstrap/lib.rs +++ b/src/bootstrap/lib.rs @@ -237,6 +237,11 @@ pub enum DocTests { Only, } +pub enum GitRepo { + Rustc, + Llvm, +} + /// Global configuration for the build system. /// /// This structure transitively contains all configuration for the build system. @@ -738,6 +743,21 @@ impl Build { self.config.jobs.unwrap_or_else(|| num_cpus::get() as u32) } + fn debuginfo_map(&self, which: GitRepo) -> Option { + if !self.config.rust_remap_debuginfo { + return None + } + + let path = match which { + GitRepo::Rustc => { + let sha = self.rust_info.sha().expect("failed to find sha"); + format!("/rustc/{}", sha) + } + GitRepo::Llvm => format!("/rustc/llvm"), + }; + Some(format!("{}={}", self.src.display(), path)) + } + /// Returns the path to the C compiler for the target specified. fn cc(&self, target: Interned) -> &Path { self.cc[&target].path() @@ -745,7 +765,7 @@ impl Build { /// Returns a list of flags to pass to the C compiler for the target /// specified. - fn cflags(&self, target: Interned) -> Vec { + fn cflags(&self, target: Interned, which: GitRepo) -> Vec { // Filter out -O and /O (the optimization flags) that we picked up from // cc-rs because the build scripts will determine that for themselves. let mut base = self.cc[&target].args().iter() @@ -767,6 +787,16 @@ impl Build { if &*target == "i686-pc-windows-gnu" { base.push("-fno-omit-frame-pointer".into()); } + + if let Some(map) = self.debuginfo_map(which) { + let cc = self.cc(target); + if cc.ends_with("clang") || cc.ends_with("gcc") { + base.push(format!("-fdebug-prefix-map={}", map).into()); + } else if cc.ends_with("clang-cl.exe") { + base.push("-Xclang".into()); + base.push(format!("-fdebug-prefix-map={}", map).into()); + } + } base } diff --git a/src/bootstrap/native.rs b/src/bootstrap/native.rs index caf38d766f5..8b115b439ed 100644 --- a/src/bootstrap/native.rs +++ b/src/bootstrap/native.rs @@ -33,6 +33,7 @@ use util::{self, exe}; use build_helper::up_to_date; use builder::{Builder, RunConfig, ShouldRun, Step}; use cache::Interned; +use GitRepo; #[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)] pub struct Llvm { @@ -369,8 +370,8 @@ fn configure_cmake(builder: &Builder, } cfg.build_arg("-j").build_arg(builder.jobs().to_string()); - cfg.define("CMAKE_C_FLAGS", builder.cflags(target).join(" ")); - let mut cxxflags = builder.cflags(target).join(" "); + cfg.define("CMAKE_C_FLAGS", builder.cflags(target, GitRepo::Llvm).join(" ")); + let mut cxxflags = builder.cflags(target, GitRepo::Llvm).join(" "); if building_dist_binaries { if builder.config.llvm_static_stdcpp && !target.contains("windows") { cxxflags.push_str(" -static-libstdc++"); @@ -676,7 +677,7 @@ impl Step for Openssl { }; configure.arg(os); configure.env("CC", builder.cc(target)); - for flag in builder.cflags(target) { + for flag in builder.cflags(target, GitRepo::Rustc) { configure.arg(flag); } // There is no specific os target for android aarch64 or x86_64, diff --git a/src/bootstrap/test.rs b/src/bootstrap/test.rs index f762d9414cf..911e16423cc 100644 --- a/src/bootstrap/test.rs +++ b/src/bootstrap/test.rs @@ -34,7 +34,7 @@ use tool::{self, Tool, SourceType}; use toolstate::ToolState; use util::{self, dylib_path, dylib_path_var}; use Crate as CargoCrate; -use {DocTests, Mode}; +use {DocTests, Mode, GitRepo}; const ADB_TEST_DIR: &str = "/data/tmp/work"; @@ -1140,7 +1140,7 @@ impl Step for Compiletest { .arg("--cxx") .arg(builder.cxx(target).unwrap()) .arg("--cflags") - .arg(builder.cflags(target).join(" ")) + .arg(builder.cflags(target, GitRepo::Rustc).join(" ")) .arg("--llvm-components") .arg(llvm_components.trim()) .arg("--llvm-cxxflags") diff --git a/src/ci/run.sh b/src/ci/run.sh index 09a0cf3541d..6a571bfad13 100755 --- a/src/ci/run.sh +++ b/src/ci/run.sh @@ -55,6 +55,7 @@ export RUST_RELEASE_CHANNEL=nightly if [ "$DEPLOY$DEPLOY_ALT" != "" ]; then RUST_CONFIGURE_ARGS="$RUST_CONFIGURE_ARGS --release-channel=$RUST_RELEASE_CHANNEL" RUST_CONFIGURE_ARGS="$RUST_CONFIGURE_ARGS --enable-llvm-static-stdcpp" + RUST_CONFIGURE_ARGS="$RUST_CONFIGURE_ARGS --set rust.remap-debuginfo" if [ "$NO_LLVM_ASSERTIONS" = "1" ]; then RUST_CONFIGURE_ARGS="$RUST_CONFIGURE_ARGS --disable-llvm-assertions" diff --git a/src/libstd/build.rs b/src/libstd/build.rs index 016e7adb4c9..0831e29bddd 100644 --- a/src/libstd/build.rs +++ b/src/libstd/build.rs @@ -97,6 +97,10 @@ fn build_libbacktrace(target: &str) -> Result<(), ()> { .file("../libbacktrace/sort.c") .file("../libbacktrace/state.c"); + let any_debug = env::var("RUSTC_DEBUGINFO").unwrap_or(String::new()) == "true" || + env::var("RUSTC_DEBUGINFO_LINES").unwrap_or(String::new()) == "true"; + build.debug(any_debug); + if target.contains("darwin") { build.file("../libbacktrace/macho.c"); } else if target.contains("windows") { diff --git a/src/test/ui/consts/const-size_of-cycle.rs b/src/test/ui/consts/const-size_of-cycle.rs index 04c054f8b6d..1ea7b973c46 100644 --- a/src/test/ui/consts/const-size_of-cycle.rs +++ b/src/test/ui/consts/const-size_of-cycle.rs @@ -8,6 +8,8 @@ // option. This file may not be copied, modified, or distributed // except according to those terms. +// ignore-musl +// ignore-x86 // error-pattern: cycle detected struct Foo { diff --git a/src/test/ui/impl-trait/impl-generic-mismatch.rs b/src/test/ui/impl-trait/impl-generic-mismatch.rs index d6707f59011..6cf8000f6ad 100644 --- a/src/test/ui/impl-trait/impl-generic-mismatch.rs +++ b/src/test/ui/impl-trait/impl-generic-mismatch.rs @@ -8,6 +8,9 @@ // option. This file may not be copied, modified, or distributed // except according to those terms. +// ignore-musl +// ignore-x86 + use std::fmt::Debug; trait Foo { diff --git a/src/test/ui/impl-trait/impl-generic-mismatch.stderr b/src/test/ui/impl-trait/impl-generic-mismatch.stderr index 7ad16b1f8f2..d777779a881 100644 --- a/src/test/ui/impl-trait/impl-generic-mismatch.stderr +++ b/src/test/ui/impl-trait/impl-generic-mismatch.stderr @@ -1,5 +1,5 @@ error[E0643]: method `foo` has incompatible signature for trait - --> $DIR/impl-generic-mismatch.rs:18:12 + --> $DIR/impl-generic-mismatch.rs:21:12 | LL | fn foo(&self, _: &impl Debug); | ---------- declaration in trait here @@ -12,7 +12,7 @@ LL | fn foo(&self, _: &impl Debug) { } | -- ^^^^^^^^^^ error[E0643]: method `bar` has incompatible signature for trait - --> $DIR/impl-generic-mismatch.rs:27:23 + --> $DIR/impl-generic-mismatch.rs:30:23 | LL | fn bar(&self, _: &U); | - declaration in trait here @@ -25,7 +25,7 @@ LL | fn bar(&self, _: &U) { } | ^^^^^^^^^^ ^ error[E0643]: method `hash` has incompatible signature for trait - --> $DIR/impl-generic-mismatch.rs:38:33 + --> $DIR/impl-generic-mismatch.rs:41:33 | LL | fn hash(&self, hasher: &mut impl Hasher) {} | ^^^^^^^^^^^ expected generic parameter, found `impl Trait` -- cgit 1.4.1-3-g733a5