From 8771319dfa545611452e23ae0f41b1b5f133514a Mon Sep 17 00:00:00 2001 From: Vadim Petrochenkov Date: Sun, 12 Apr 2020 21:02:48 +0300 Subject: [PATCH 1/6] rustbuild: Remove LLD flavor workaround for MSVC --- src/bootstrap/bin/rustc.rs | 5 ----- src/bootstrap/builder.rs | 16 ---------------- 2 files changed, 21 deletions(-) diff --git a/src/bootstrap/bin/rustc.rs b/src/bootstrap/bin/rustc.rs index daa030c59d641..a8c00c8c3ca88 100644 --- a/src/bootstrap/bin/rustc.rs +++ b/src/bootstrap/bin/rustc.rs @@ -134,11 +134,6 @@ fn main() { cmd.arg(format!("-Clinker={}", host_linker)); } - // Override linker flavor if necessary. - if let Ok(host_linker_flavor) = env::var("RUSTC_HOST_LINKER_FLAVOR") { - cmd.arg(format!("-Clinker-flavor={}", host_linker_flavor)); - } - if let Ok(s) = env::var("RUSTC_HOST_CRT_STATIC") { if s == "true" { cmd.arg("-C").arg("target-feature=+crt-static"); diff --git a/src/bootstrap/builder.rs b/src/bootstrap/builder.rs index 7fc089d18f113..8d6c2db792645 100644 --- a/src/bootstrap/builder.rs +++ b/src/bootstrap/builder.rs @@ -969,27 +969,11 @@ impl<'a> Builder<'a> { // See https://github.com/rust-lang/rust/issues/68647. let can_use_lld = mode != Mode::Std; - // FIXME: The beta compiler doesn't pick the `lld-link` flavor for `*-pc-windows-msvc` - // Remove `RUSTC_HOST_LINKER_FLAVOR` when this is fixed - let lld_linker_flavor = |linker: &Path, target: Interned| { - compiler.stage == 0 - && linker.file_name() == Some(OsStr::new("rust-lld")) - && target.contains("pc-windows-msvc") - }; - if let Some(host_linker) = self.linker(compiler.host, can_use_lld) { - if lld_linker_flavor(host_linker, compiler.host) { - cargo.env("RUSTC_HOST_LINKER_FLAVOR", "lld-link"); - } - cargo.env("RUSTC_HOST_LINKER", host_linker); } if let Some(target_linker) = self.linker(target, can_use_lld) { - if lld_linker_flavor(target_linker, target) { - rustflags.arg("-Clinker-flavor=lld-link"); - } - let target = crate::envify(&target); cargo.env(&format!("CARGO_TARGET_{}_LINKER", target), target_linker); } From 09633062b692edd9a7534488c0d04e5de5497ed1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tomasz=20Mi=C4=85sko?= Date: Mon, 13 Apr 2020 00:00:00 +0000 Subject: [PATCH 2/6] Update compiler_builtins to 0.1.27 * aarch64: Exclude FP intrinsics on +nofp or +nosimd * Place intrinsics in individual object files --- Cargo.lock | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 73d276d177648..73eaa2fa43b85 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -566,9 +566,9 @@ dependencies = [ [[package]] name = "compiler_builtins" -version = "0.1.25" +version = "0.1.27" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "438ac08ddc5efe81452f984a9e33ba425b00b31d1f48e6acd9e2210aa28cc52e" +checksum = "38f18416546abfbf8d801c555a0e99524453e7214f9cc9107ad49de3d5948ccc" dependencies = [ "cc", "rustc-std-workspace-core", From ce994b633d9143dd00140c64fe53194a2927dff1 Mon Sep 17 00:00:00 2001 From: Duddino Date: Tue, 14 Apr 2020 17:31:59 +0200 Subject: [PATCH 3/6] Provide better compiler output when using `?` on `Option` in fn returning `Result` and vice-versa --- .../traits/error_reporting/mod.rs | 23 ++++++++++++++- src/test/ui/option-to-result.rs | 13 +++++++++ src/test/ui/option-to-result.stderr | 29 +++++++++++++++++++ src/test/ui/try-on-option.stderr | 4 +++ 4 files changed, 68 insertions(+), 1 deletion(-) create mode 100644 src/test/ui/option-to-result.rs create mode 100644 src/test/ui/option-to-result.stderr diff --git a/src/librustc_trait_selection/traits/error_reporting/mod.rs b/src/librustc_trait_selection/traits/error_reporting/mod.rs index fef7adf02246b..a77ea33bcde09 100644 --- a/src/librustc_trait_selection/traits/error_reporting/mod.rs +++ b/src/librustc_trait_selection/traits/error_reporting/mod.rs @@ -292,7 +292,7 @@ impl<'a, 'tcx> InferCtxtExt<'tcx> for InferCtxt<'a, 'tcx> { )), Some( "the question mark operation (`?`) implicitly performs a \ - conversion on the error value using the `From` trait" + conversion on the error value using the `From` trait" .to_owned(), ), ) @@ -312,6 +312,27 @@ impl<'a, 'tcx> InferCtxtExt<'tcx> for InferCtxt<'a, 'tcx> { )) ); + let should_convert_option_to_result = + format!("{}", trait_ref.print_only_trait_path()) + .starts_with("std::convert::From` into a `Result` using `Option::ok_or` or `Option::ok_or_else`", + ".ok_or_else(|_| /* error value */)".to_string(), + Applicability::HasPlaceholders, + ); + } else if is_try && is_from && should_convert_result_to_option { + err.span_suggestion_verbose( + span.shrink_to_lo(), + "consider converting the `Result` into an `Option` using `Result::ok`", + ".ok()".to_string(), + Applicability::HasPlaceholders, + ); + } + let explanation = if obligation.cause.code == ObligationCauseCode::MainFunctionType { "consider using `()`, or a `Result`".to_owned() diff --git a/src/test/ui/option-to-result.rs b/src/test/ui/option-to-result.rs new file mode 100644 index 0000000000000..00e8b5244c54a --- /dev/null +++ b/src/test/ui/option-to-result.rs @@ -0,0 +1,13 @@ +fn main(){ } + +fn test_result() -> Result<(),()> { + let a:Option<()> = Some(()); + a?;//~ ERROR `?` couldn't convert the error + Ok(()) +} + +fn test_option() -> Option{ + let a:Result = Ok(5); + a?;//~ ERROR `?` couldn't convert the error + Some(5) +} diff --git a/src/test/ui/option-to-result.stderr b/src/test/ui/option-to-result.stderr new file mode 100644 index 0000000000000..3c51bcece570b --- /dev/null +++ b/src/test/ui/option-to-result.stderr @@ -0,0 +1,29 @@ +error[E0277]: `?` couldn't convert the error to `()` + --> $DIR/option-to-result.rs:5:6 + | +LL | a?; + | ^ the trait `std::convert::From` is not implemented for `()` + | + = note: the question mark operation (`?`) implicitly performs a conversion on the error value using the `From` trait + = note: required by `std::convert::From::from` +help: consider converting the `Option` into a `Result` using `Option::ok_or` or `Option::ok_or_else` + | +LL | a.ok_or_else(|_| /* error value */)?; + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + +error[E0277]: `?` couldn't convert the error to `std::option::NoneError` + --> $DIR/option-to-result.rs:11:6 + | +LL | a?; + | ^ the trait `std::convert::From` is not implemented for `std::option::NoneError` + | + = note: the question mark operation (`?`) implicitly performs a conversion on the error value using the `From` trait + = note: required by `std::convert::From::from` +help: consider converting the `Result` into an `Option` using `Result::ok` + | +LL | a.ok()?; + | ^^^^^ + +error: aborting due to 2 previous errors + +For more information about this error, try `rustc --explain E0277`. diff --git a/src/test/ui/try-on-option.stderr b/src/test/ui/try-on-option.stderr index 07615b52a48a5..d1c0276a67ad2 100644 --- a/src/test/ui/try-on-option.stderr +++ b/src/test/ui/try-on-option.stderr @@ -6,6 +6,10 @@ LL | x?; | = note: the question mark operation (`?`) implicitly performs a conversion on the error value using the `From` trait = note: required by `std::convert::From::from` +help: consider converting the `Option` into a `Result` using `Option::ok_or` or `Option::ok_or_else` + | +LL | x.ok_or_else(|_| /* error value */)?; + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ error[E0277]: the `?` operator can only be used in a function that returns `Result` or `Option` (or another type that implements `std::ops::Try`) --> $DIR/try-on-option.rs:13:5 From 84c4514849180867f8444af33d8b343cb98593f5 Mon Sep 17 00:00:00 2001 From: topecongiro Date: Wed, 15 Apr 2020 11:07:33 +0900 Subject: [PATCH 4/6] Bump rustfmt and rls --- Cargo.lock | 87 +++++++++++++++++++++++++---------------------- src/tools/rls | 2 +- src/tools/rustfmt | 2 +- 3 files changed, 48 insertions(+), 43 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index e229448df0477..1113c124b046f 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -2704,9 +2704,9 @@ dependencies = [ [[package]] name = "racer" -version = "2.1.32" +version = "2.1.33" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e805a6c323d08b26270f0276cef35608456916dc266ef27434edbe666eceeeb5" +checksum = "54322b696f7df20e0d79d0244a1088f387b7164a5f17987c4ab984dec1a23e42" dependencies = [ "bitflags", "clap", @@ -3146,9 +3146,9 @@ dependencies = [ [[package]] name = "rustc-ap-arena" -version = "651.0.0" +version = "654.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "632704fb93ca8148957191e5d2d827082f93c4aa20cdd242fb46d8cca57029da" +checksum = "81dfcfbb0ddfd533abf8c076e3b49d1e5042d1962526a12ce2c66d514b24cca3" dependencies = [ "rustc-ap-rustc_data_structures", "smallvec 1.0.0", @@ -3156,15 +3156,15 @@ dependencies = [ [[package]] name = "rustc-ap-graphviz" -version = "651.0.0" +version = "654.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bdd4689b814859c9f1b3e314ed2bde596acac428a256a16894635f600bed46b4" +checksum = "7490bb07b014a7f9531bde33c905a805e08095dbefdb4c9988a1b19fe6d019fd" [[package]] name = "rustc-ap-rustc_ast" -version = "651.0.0" +version = "654.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "101c1517d3fd19d083aaca5b113f9965e6ae353a0bb09c49959b0f62b95b75d9" +checksum = "189f16dbb8dd11089274c9ced58b0cae9e1ea3e434a58f3db683817eda849e58" dependencies = [ "log", "rustc-ap-rustc_data_structures", @@ -3179,10 +3179,11 @@ dependencies = [ [[package]] name = "rustc-ap-rustc_ast_passes" -version = "651.0.0" +version = "654.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3ab3f5a7e939b37c99d8ca371f09b10bb5b5c85ad5d5b8d1d736ce8248c71be0" +checksum = "bbe619609b56a617fa986332b066d53270093c816d8ff8281fc90e1dbe74c1cc" dependencies = [ + "itertools 0.8.0", "log", "rustc-ap-rustc_ast", "rustc-ap-rustc_ast_pretty", @@ -3197,9 +3198,9 @@ dependencies = [ [[package]] name = "rustc-ap-rustc_ast_pretty" -version = "651.0.0" +version = "654.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "05046d3a2b8de22b20bcda9a1c063dc5c1f2f721f042b6c2809df2d23c64a13e" +checksum = "26ab1495f7b420e937688749c1da5763aaabd6ebe8cacb758665a0b8481da094" dependencies = [ "log", "rustc-ap-rustc_ast", @@ -3209,9 +3210,9 @@ dependencies = [ [[package]] name = "rustc-ap-rustc_attr" -version = "651.0.0" +version = "654.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f00b7ccad6fc3628fb44950435772945a425575f9ea0b3708c536fe75623a6e8" +checksum = "2e057495724c60729c1d1d9d49374e0b3ebd6d3481cd161b2871f52fe017b7b5" dependencies = [ "rustc-ap-rustc_ast", "rustc-ap-rustc_ast_pretty", @@ -3227,9 +3228,9 @@ dependencies = [ [[package]] name = "rustc-ap-rustc_data_structures" -version = "651.0.0" +version = "654.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4c6121ab6766644fa76b711f65d4c39f2e335488ab768324567fed0ed191166e" +checksum = "d2130997667833692f4bec4681d0e73b066d5a01dac1d8a68f22068b82bf173a" dependencies = [ "bitflags", "cfg-if", @@ -3238,6 +3239,7 @@ dependencies = [ "indexmap", "jobserver", "lazy_static 1.4.0", + "libc", "log", "measureme", "parking_lot 0.10.0", @@ -3254,9 +3256,9 @@ dependencies = [ [[package]] name = "rustc-ap-rustc_errors" -version = "651.0.0" +version = "654.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "adab84c842003ad1c8435fd71b8d0cc19bf0d702a8a2147d5be06e083db2d207" +checksum = "908e1ea187c6bb368af4ba6db980001e920515e67371ddc4086e749baabe6080" dependencies = [ "annotate-snippets", "atty", @@ -3272,9 +3274,9 @@ dependencies = [ [[package]] name = "rustc-ap-rustc_expand" -version = "651.0.0" +version = "654.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bb001df541ea02b65c8e294252530010c6f90e3c6a5716e8e24e58c12dd1cd86" +checksum = "50066a75bca872ff933b0ee8a582d18ef1876c8054a392f60c39e538446bfb00" dependencies = [ "log", "rustc-ap-rustc_ast", @@ -3294,9 +3296,9 @@ dependencies = [ [[package]] name = "rustc-ap-rustc_feature" -version = "651.0.0" +version = "654.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "446cc60613cc3b05d0bdbcab7feb02305790b5617fa43c532d51ae3223d677a4" +checksum = "96fb53e1710e6de7c2e371ca56c857b79f9b399aba58aa6b6fbed6e2f677d3f6" dependencies = [ "lazy_static 1.4.0", "rustc-ap-rustc_data_structures", @@ -3305,15 +3307,15 @@ dependencies = [ [[package]] name = "rustc-ap-rustc_fs_util" -version = "651.0.0" +version = "654.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9ac99d6f67e7db3bb300895630e769ed41bd3e336c0e725870c70e676c1a5ff1" +checksum = "e3f91357e5e468fc2729211571d769723c728a34e200d90a70164e945f881e09" [[package]] name = "rustc-ap-rustc_index" -version = "651.0.0" +version = "654.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5608c1cf50d2251b7e10a138cf6dd388e97f139b21c00b06a22d06f89c6591f6" +checksum = "32220c3e6cdf226f38e4474b747dca15f3106bb680c74f10b299af3f6cdb1663" dependencies = [ "rustc-ap-serialize", "smallvec 1.0.0", @@ -3321,18 +3323,18 @@ dependencies = [ [[package]] name = "rustc-ap-rustc_lexer" -version = "651.0.0" +version = "654.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "74e9c1c6f5dc85977b3adb6fb556b2ff23354d1a12021da15eb1d36353458bde" +checksum = "3b324d2a2bacad344e53e182e5ca04ffb74745b932849aa074f8f7fec8177da5" dependencies = [ "unicode-xid 0.2.0", ] [[package]] name = "rustc-ap-rustc_macros" -version = "651.0.0" +version = "654.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3226b5ec864312a5d23eb40a5d621ee06bdc0754228d20d6eb76d4ddc4f2d4a1" +checksum = "59686c56d5f1b3ed47d0f070c257ed35caf24ecf2d744dd11fe44b1014baee0f" dependencies = [ "proc-macro2 1.0.3", "quote 1.0.2", @@ -3342,9 +3344,9 @@ dependencies = [ [[package]] name = "rustc-ap-rustc_parse" -version = "651.0.0" +version = "654.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ba3b042344c2280b50d5df0058d11379028a8f016a407e575bb3ea8b6c798049" +checksum = "2dfb0c11c591ec5f87bbadb10819795abc9035ff79a26703c1b6c9487ac51f49" dependencies = [ "bitflags", "log", @@ -3362,10 +3364,11 @@ dependencies = [ [[package]] name = "rustc-ap-rustc_session" -version = "651.0.0" +version = "654.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ff35ef4b5d9fbcb2fd539c7c908eb3cdd1f68ddbccd042945ef50ae65564f941" +checksum = "3d1a194b1a81d7233ee492847638dc9ebdb7d084300e5ade8dea0ceaa98f95b9" dependencies = [ + "getopts", "log", "num_cpus", "rustc-ap-rustc_ast", @@ -3381,26 +3384,28 @@ dependencies = [ [[package]] name = "rustc-ap-rustc_span" -version = "651.0.0" +version = "654.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e323b1f4a824039886eed8e33cad20ea4f492a9f9b3c9441009797c91de3e87a" +checksum = "a648146050fed6b58e681ec22488e728f60e16036bb7497c9815e3debd1e4242" dependencies = [ "cfg-if", "log", + "md-5", "rustc-ap-arena", "rustc-ap-rustc_data_structures", "rustc-ap-rustc_index", "rustc-ap-rustc_macros", "rustc-ap-serialize", "scoped-tls", + "sha-1", "unicode-width", ] [[package]] name = "rustc-ap-rustc_target" -version = "651.0.0" +version = "654.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e161eb7b3a5b7993c6b480135296dc61476db80041d49dd446422742426e390b" +checksum = "28cf28798f0988b808e3616713630e4098d68c6f1f41052a2f7e922e094da744" dependencies = [ "bitflags", "log", @@ -3413,9 +3418,9 @@ dependencies = [ [[package]] name = "rustc-ap-serialize" -version = "651.0.0" +version = "654.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "af510a659098d8c45a7303fb882fa780f4a87ec5f5d7a2053521e7d5d7f332c4" +checksum = "756e8f526ec7906e132188bf25e3c10a6ee42ab77294ecb3b3602647f0508eef" dependencies = [ "indexmap", "smallvec 1.0.0", @@ -4404,7 +4409,7 @@ dependencies = [ [[package]] name = "rustfmt-nightly" -version = "1.4.13" +version = "1.4.14" dependencies = [ "annotate-snippets", "bytecount", diff --git a/src/tools/rls b/src/tools/rls index 1cfb87845f457..2659cbf14bfb0 160000 --- a/src/tools/rls +++ b/src/tools/rls @@ -1 +1 @@ -Subproject commit 1cfb87845f45758442830506b7242947dfc989d9 +Subproject commit 2659cbf14bfb0929a16d7ce9b6858d0bb286ede7 diff --git a/src/tools/rustfmt b/src/tools/rustfmt index c1267303bc064..a5cb5d26833cf 160000 --- a/src/tools/rustfmt +++ b/src/tools/rustfmt @@ -1 +1 @@ -Subproject commit c1267303bc06408b4ce406175e8f9cddbbe11b92 +Subproject commit a5cb5d26833cfda6fa2ed35735448953f728bd5e From fbc4168d809dae0408c2520ccfe585f564ad4a0b Mon Sep 17 00:00:00 2001 From: Duddino Date: Wed, 15 Apr 2020 10:57:22 +0200 Subject: [PATCH 5/6] Provide better compiler output when using `?` on `Option` in fn returning `Result` and vice-versa --- src/librustc_trait_selection/traits/error_reporting/mod.rs | 4 ++-- src/test/ui/option-to-result.stderr | 4 ++-- src/test/ui/try-on-option.stderr | 4 ++-- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/src/librustc_trait_selection/traits/error_reporting/mod.rs b/src/librustc_trait_selection/traits/error_reporting/mod.rs index a77ea33bcde09..904720125d3d7 100644 --- a/src/librustc_trait_selection/traits/error_reporting/mod.rs +++ b/src/librustc_trait_selection/traits/error_reporting/mod.rs @@ -321,7 +321,7 @@ impl<'a, 'tcx> InferCtxtExt<'tcx> for InferCtxt<'a, 'tcx> { err.span_suggestion_verbose( span.shrink_to_lo(), "consider converting the `Option` into a `Result` using `Option::ok_or` or `Option::ok_or_else`", - ".ok_or_else(|_| /* error value */)".to_string(), + ".ok_or_else(|| /* error value */)".to_string(), Applicability::HasPlaceholders, ); } else if is_try && is_from && should_convert_result_to_option { @@ -329,7 +329,7 @@ impl<'a, 'tcx> InferCtxtExt<'tcx> for InferCtxt<'a, 'tcx> { span.shrink_to_lo(), "consider converting the `Result` into an `Option` using `Result::ok`", ".ok()".to_string(), - Applicability::HasPlaceholders, + Applicability::MachineApplicable, ); } diff --git a/src/test/ui/option-to-result.stderr b/src/test/ui/option-to-result.stderr index 3c51bcece570b..f673ef7fc1e69 100644 --- a/src/test/ui/option-to-result.stderr +++ b/src/test/ui/option-to-result.stderr @@ -8,8 +8,8 @@ LL | a?; = note: required by `std::convert::From::from` help: consider converting the `Option` into a `Result` using `Option::ok_or` or `Option::ok_or_else` | -LL | a.ok_or_else(|_| /* error value */)?; - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +LL | a.ok_or_else(|| /* error value */)?; + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ error[E0277]: `?` couldn't convert the error to `std::option::NoneError` --> $DIR/option-to-result.rs:11:6 diff --git a/src/test/ui/try-on-option.stderr b/src/test/ui/try-on-option.stderr index d1c0276a67ad2..7a4bb75967b1f 100644 --- a/src/test/ui/try-on-option.stderr +++ b/src/test/ui/try-on-option.stderr @@ -8,8 +8,8 @@ LL | x?; = note: required by `std::convert::From::from` help: consider converting the `Option` into a `Result` using `Option::ok_or` or `Option::ok_or_else` | -LL | x.ok_or_else(|_| /* error value */)?; - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +LL | x.ok_or_else(|| /* error value */)?; + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ error[E0277]: the `?` operator can only be used in a function that returns `Result` or `Option` (or another type that implements `std::ops::Try`) --> $DIR/try-on-option.rs:13:5 From 0fcdefb5592207c328a5d8a5f3496121e170d9c0 Mon Sep 17 00:00:00 2001 From: Guillaume Gomez Date: Wed, 15 Apr 2020 14:20:40 +0200 Subject: [PATCH 6/6] Clean up E0518 explanation --- src/librustc_error_codes/error_codes/E0518.md | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/librustc_error_codes/error_codes/E0518.md b/src/librustc_error_codes/error_codes/E0518.md index 1af9a3735fe1a..f04329bc4e618 100644 --- a/src/librustc_error_codes/error_codes/E0518.md +++ b/src/librustc_error_codes/error_codes/E0518.md @@ -1,7 +1,7 @@ -This error indicates that an `#[inline(..)]` attribute was incorrectly placed -on something other than a function or method. +An `#[inline(..)]` attribute was incorrectly placed on something other than a +function or method. -Examples of erroneous code: +Example of erroneous code: ```compile_fail,E0518 #[inline(always)]