Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Lint ignored #[inline] on function prototypes #65294

Merged
merged 12 commits into from
Oct 29, 2019

Conversation

varkor
Copy link
Member

@varkor varkor commented Oct 11, 2019

Fixes #51280.

  • Adds a unused_attribute lint for #[inline] on function prototypes.
  • As a consequence, foreign items, impl items and trait items now have their attributes checked, which could cause some code to no longer compile (it was previously erroneously ignored).

@rust-highfive
Copy link
Collaborator

r? @matthewjasper

(rust_highfive has picked a reviewer for you, use r? to override)

@rust-highfive rust-highfive added the S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. label Oct 11, 2019
@rust-highfive
Copy link
Collaborator

The job x86_64-gnu-llvm-6.0 of your PR failed (pretty log, raw log). Through arcane magic we have determined that the following fragments from the build log may contain information about the problem.

Click to expand the log.
2019-10-11T01:43:19.0836625Z ##[command]git remote add origin https://github.com/rust-lang/rust
2019-10-11T01:43:19.0923997Z ##[command]git config gc.auto 0
2019-10-11T01:43:19.1011319Z ##[command]git config --get-all http.https://github.com/rust-lang/rust.extraheader
2019-10-11T01:43:19.1078670Z ##[command]git config --get-all http.proxy
2019-10-11T01:43:19.1214486Z ##[command]git -c http.extraheader="AUTHORIZATION: basic ***" fetch --force --tags --prune --progress --no-recurse-submodules --depth=2 origin +refs/heads/*:refs/remotes/origin/* +refs/pull/65294/merge:refs/remotes/pull/65294/merge
---
2019-10-11T02:15:09.5374260Z    Compiling jobserver v0.1.16
2019-10-11T02:15:11.9251952Z    Compiling env_logger v0.7.0
2019-10-11T02:15:12.5820649Z    Compiling rustc-hash v1.0.1
2019-10-11T02:15:12.6895384Z    Compiling rustc_apfloat v0.0.0 (/checkout/src/librustc_apfloat)
2019-10-11T02:15:12.8708523Z error[E0518]: attribute should be applied to function or closure
2019-10-11T02:15:12.8708962Z    --> <::bitflags::__impl_bitflags macros>:73:22
2019-10-11T02:15:12.8709318Z     |
2019-10-11T02:15:12.8711001Z 1   |   /   ($ BitFlags : ident : $ T : ty
2019-10-11T02:15:12.8711767Z 3   |   |        $
2019-10-11T02:15:12.8711767Z 3   |   |        $
2019-10-11T02:15:12.8712190Z 4   |   |        ($ (# [$ attr : ident $ ($ args : tt) *]) * $ Flag : ident = $ value :
2019-10-11T02:15:12.8712510Z ...     |
2019-10-11T02:15:12.8712925Z 73  |   |                   { $ (# [inline] const $ Flag : $ T = 0 ;) + } impl __BitFlags
2019-10-11T02:15:12.8713675Z     |   |                        ^^^^^^^^^^ ------------------------ not a function or closure
2019-10-11T02:15:12.8714041Z ...     |
2019-10-11T02:15:12.8714456Z 248 |   |   } ; ($ (# [$ filtered : meta]) * const $ ($ item : tt) *) =>
2019-10-11T02:15:12.8714856Z 249 |   |   { $ (# [$ filtered]) * const $ ($ item) * } ;
2019-10-11T02:15:12.8715668Z     |   |_______________________________________________- in this expansion of `__impl_bitflags!` (#3)
2019-10-11T02:15:12.8715986Z     | 
2019-10-11T02:15:12.8716573Z    ::: <::bitflags::__bitflags macros>:1:1
2019-10-11T02:15:12.8716882Z     |
2019-10-11T02:15:12.8717323Z 1   |     / ($ (# [$ outer : meta]) * ($ ($ vis : tt) *) $ BitFlags : ident : $ T : ty
2019-10-11T02:15:12.8717724Z 2   |     |  {
2019-10-11T02:15:12.8718091Z 3   |     |      $
2019-10-11T02:15:12.8718539Z 4   |     |      ($ (# [$ inner : ident $ ($ args : tt) *]) * $ Flag : ident = $ value :
2019-10-11T02:15:12.8718871Z ...       |
2019-10-11T02:15:12.8719303Z 10  |     |     struct $ BitFlags { bits : $ T, } __impl_bitflags !
2019-10-11T02:15:12.8719684Z     |  ___|_______________________________________-
2019-10-11T02:15:12.8720091Z 11  | |   |     {
2019-10-11T02:15:12.8720497Z 12  | |   |         $ BitFlags : $ T
2019-10-11T02:15:12.8720983Z 13  | |   |         { $ ($ (# [$ inner $ ($ args) *]) * $ Flag = $ value ;) + }
2019-10-11T02:15:12.8721776Z     | |___|_____- in this macro invocation (#3)
2019-10-11T02:15:12.8722165Z 15  |     | } ;
2019-10-11T02:15:12.8722165Z 15  |     | } ;
2019-10-11T02:15:12.8722571Z     |     |___- in this expansion of `__bitflags!` (#2)
2019-10-11T02:15:12.8722862Z     | 
2019-10-11T02:15:12.8723176Z    ::: <::bitflags::bitflags macros>:1:1
2019-10-11T02:15:12.8723433Z     |
2019-10-11T02:15:12.8723878Z 1   |    /  ($ (# [$ outer : meta]) * pub struct $ BitFlags : ident : $ T : ty
2019-10-11T02:15:12.8724238Z 2   |    |   {
2019-10-11T02:15:12.8724617Z 3   |    |       $
2019-10-11T02:15:12.8725582Z 4   |    |       ($ (# [$ inner : ident $ ($ args : tt) *]) * const $ Flag : ident = $
2019-10-11T02:15:12.8725935Z ...      |
2019-10-11T02:15:12.8726309Z 8   |  / |      __bitflags !
2019-10-11T02:15:12.8726720Z 9   |  | |      {
2019-10-11T02:15:12.8727185Z 10  |  | |          $ (# [$ outer]) * (pub) $ BitFlags : $ T
2019-10-11T02:15:12.8727820Z 11  |  | |          { $ ($ (# [$ inner $ ($ args) *]) * $ Flag = $ value ;) + }
2019-10-11T02:15:12.8773575Z     |  |_|______- in this macro invocation (#2)
2019-10-11T02:15:12.8773931Z ...      |
2019-10-11T02:15:12.8774269Z 39  |    |      }
2019-10-11T02:15:12.8774600Z 40  |    |  } ;
2019-10-11T02:15:12.8774600Z 40  |    |  } ;
2019-10-11T02:15:12.8775333Z     |    |____- in this expansion of `bitflags::bitflags!` (#1)
2019-10-11T02:15:12.8775992Z    ::: src/librustc_apfloat/lib.rs:48:1
2019-10-11T02:15:12.8776244Z     |
2019-10-11T02:15:12.8776583Z 48  | /     bitflags::bitflags! {
2019-10-11T02:15:12.8776583Z 48  | /     bitflags::bitflags! {
2019-10-11T02:15:12.8776975Z 49  | |         /// IEEE-754R 7: Default exception handling.
2019-10-11T02:15:12.8777312Z 50  | |         ///
2019-10-11T02:15:12.8777702Z 51  | |         /// UNDERFLOW or OVERFLOW are always returned or-ed with INEXACT.
2019-10-11T02:15:12.8778344Z 60  | |         }
2019-10-11T02:15:12.8778662Z 61  | |     }
2019-10-11T02:15:12.8779031Z     | |_____- in this macro invocation (#1)
2019-10-11T02:15:12.8779124Z 
---
2019-10-11T02:15:14.2458568Z == clock drift check ==
2019-10-11T02:15:14.2477280Z   local time: Fri Oct 11 02:15:14 UTC 2019
2019-10-11T02:15:14.3990238Z   network time: Fri, 11 Oct 2019 02:15:14 GMT
2019-10-11T02:15:14.3995582Z == end clock drift check ==
2019-10-11T02:15:15.3551616Z ##[error]Bash exited with code '1'.
2019-10-11T02:15:15.3604602Z ##[section]Starting: Checkout
2019-10-11T02:15:15.3607259Z ==============================================================================
2019-10-11T02:15:15.3607327Z Task         : Get sources
2019-10-11T02:15:15.3607382Z Description  : Get sources from a repository. Supports Git, TfsVC, and SVN repositories.

I'm a bot! I can only do what humans tell me to, so if this was not helpful or you have suggestions for improvements, please ping or otherwise contact @TimNN. (Feature Requests)

@Centril
Copy link
Contributor

Centril commented Oct 11, 2019

cc @rust-lang/lang This seems like a reasonable extension of the unused_attributes lint so I'm not going to I-nominate the PR for a language team meeting to save us time but I thought y'all should be aware. :)

@varkor
Copy link
Member Author

varkor commented Oct 11, 2019

We should do a crater run of this once it builds, because it's possible (as seen in bitflags) that there are accidental #[inline] attributes on trait or extern items that don't permit them. Hopefully we can just fix the fallout; it'd be ugly to have to continue to allow these for some time.

@cramertj
Copy link
Member

Hopefully we can just fix the fallout; it'd be ugly to have to continue to allow these for some time.

This is just a lint, right? I don't think we need a crater run to ward off ecosystem breakage for new lints, especially on one that's so niche.

@Centril
Copy link
Contributor

Centril commented Oct 11, 2019

If you look at the diff it introduces both warnings and errors in different places.

@nikomatsakis
Copy link
Contributor

Based on my skimming of the tests, is it correct that the errors arise when #[inline] is applied to non-functions, like consts or statics? And this used to just be ignored or something?

@varkor
Copy link
Member Author

varkor commented Oct 11, 2019

Errors were previously emitted on #[inline] on consts or statics (any non-functions), but they were not being emitted on associated/foreign items (which was an oversight). Now they're emitted on any item, which was a natural consequence of adding the lint for #[inline] on prototypes.

So this adds both a lint, but also errors that had previously accidentally been left out.

@varkor varkor added S-blocked Status: Blocked on something else such as an RFC or other implementation work. and removed S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. labels Oct 11, 2019
src/librustc/hir/check_attr.rs Show resolved Hide resolved
src/librustc/hir/check_attr.rs Outdated Show resolved Hide resolved
@rust-highfive

This comment has been minimized.

@rust-highfive

This comment has been minimized.

@varkor varkor force-pushed the lint-inline-prototype branch from 8efdaee to 15c5973 Compare October 14, 2019 14:09
@rust-highfive

This comment has been minimized.

@varkor
Copy link
Member Author

varkor commented Oct 14, 2019

@bors try

@bors
Copy link
Contributor

bors commented Oct 14, 2019

⌛ Trying commit 185b013a9f9d1286e7ae78ff1593d10dcca8b2f8 with merge 38f08371587f97c145dedb2c055ac7b01bf1e788...

@bors
Copy link
Contributor

bors commented Oct 14, 2019

☀️ Try build successful - checks-azure
Build commit: 38f08371587f97c145dedb2c055ac7b01bf1e788 (38f08371587f97c145dedb2c055ac7b01bf1e788)

@varkor
Copy link
Member Author

varkor commented Oct 14, 2019

@craterbot check

@craterbot
Copy link
Collaborator

👌 Experiment pr-65294 created and queued.
🤖 Automatically detected try build 38f08371587f97c145dedb2c055ac7b01bf1e788
🔍 You can check out the queue and this experiment's details.

ℹ️ Crater is a tool to run experiments across parts of the Rust ecosystem. Learn more

@craterbot craterbot added S-waiting-on-crater Status: Waiting on a crater run to be completed. and removed S-blocked Status: Blocked on something else such as an RFC or other implementation work. labels Oct 14, 2019
@craterbot
Copy link
Collaborator

🚧 Experiment pr-65294 is now running

ℹ️ Crater is a tool to run experiments across parts of the Rust ecosystem. Learn more

@craterbot
Copy link
Collaborator

🎉 Experiment pr-65294 is completed!
📊 2540 regressed and 0 fixed (74234 total)
📰 Open the full report.

⚠️ If you notice any spurious failure please add them to the blacklist!
ℹ️ Crater is a tool to run experiments across parts of the Rust ecosystem. Learn more

@bors bors added the S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. label Oct 28, 2019
Centril added a commit to Centril/rust that referenced this pull request Oct 29, 2019
…thewjasper

Lint ignored `#[inline]` on function prototypes

Fixes rust-lang#51280.

- Adds a `unused_attribute` lint for `#[inline]` on function prototypes.
- As a consequence, foreign items, impl items and trait items now have their attributes checked, which could cause some code to no longer compile (it was previously erroneously ignored).
Centril added a commit to Centril/rust that referenced this pull request Oct 29, 2019
…thewjasper

Lint ignored `#[inline]` on function prototypes

Fixes rust-lang#51280.

- Adds a `unused_attribute` lint for `#[inline]` on function prototypes.
- As a consequence, foreign items, impl items and trait items now have their attributes checked, which could cause some code to no longer compile (it was previously erroneously ignored).
@bors
Copy link
Contributor

bors commented Oct 29, 2019

⌛ Testing commit f47f530 with merge a77114b5f48a74317d731c20883212038125667b...

Centril added a commit to Centril/rust that referenced this pull request Oct 29, 2019
…thewjasper

Lint ignored `#[inline]` on function prototypes

Fixes rust-lang#51280.

- Adds a `unused_attribute` lint for `#[inline]` on function prototypes.
- As a consequence, foreign items, impl items and trait items now have their attributes checked, which could cause some code to no longer compile (it was previously erroneously ignored).
@Centril
Copy link
Contributor

Centril commented Oct 29, 2019

@bors retry

bors added a commit that referenced this pull request Oct 29, 2019
Rollup of 5 pull requests

Successful merges:

 - #65294 (Lint ignored `#[inline]` on function prototypes)
 - #65318 (Call out the types that are non local on E0117)
 - #65531 (Update backtrace to 0.3.40)
 - #65562 (Improve the "try using a variant of the expected type" hint.)
 - #65809 (Add new EFIAPI ABI)

Failed merges:

r? @ghost
@bors
Copy link
Contributor

bors commented Oct 29, 2019

⌛ Testing commit f47f530 with merge 2dd4e73...

@bors
Copy link
Contributor

bors commented Oct 29, 2019

☔ The latest upstream changes (presumably #65919) made this pull request unmergeable. Please resolve the merge conflicts.

@bors bors added S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. and removed S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. labels Oct 29, 2019
@bors bors merged commit f47f530 into rust-lang:master Oct 29, 2019
netbsd-srcmastr pushed a commit to NetBSD/pkgsrc that referenced this pull request Jan 6, 2020
Version 1.40.0 (2019-12-19)
===========================

Language
--------
- [You can now use tuple `struct`s and tuple `enum` variant's constructors in
  `const` contexts.][65188] e.g.

  ```rust
  pub struct Point(i32, i32);

  const ORIGIN: Point = {
      let constructor = Point;

      constructor(0, 0)
  };
  ```

- [You can now mark `struct`s, `enum`s, and `enum` variants with the `#[non_exhaustive]` attribute to
  indicate that there may be variants or fields added in the future.][64639]
  For example this requires adding a wild-card branch (`_ => {}`) to any match
  statements on a non-exhaustive `enum`. [(RFC 2008)]
- [You can now use function-like procedural macros in `extern` blocks and in
  type positions.][63931] e.g. `type Generated = macro!();`
- [Function-like and attribute procedural macros can now emit
  `macro_rules!` items, so you can now have your macros generate macros.][64035]
- [The `meta` pattern matcher in `macro_rules!` now correctly matches the modern
  attribute syntax.][63674] For example `(#[$m:meta])` now matches `#[attr]`,
  `#[attr{tokens}]`, `#[attr[tokens]]`, and `#[attr(tokens)]`.

Compiler
--------
- [Added tier 3 support\* for the
  `thumbv7neon-unknown-linux-musleabihf` target.][66103]
- [Added tier 3 support for the
  `aarch64-unknown-none-softfloat` target.][64589]
- [Added tier 3 support for the `mips64-unknown-linux-muslabi64`, and
  `mips64el-unknown-linux-muslabi64` targets.][65843]

\* Refer to Rust's [platform support page][forge-platform-support] for more
  information on Rust's tiered platform support.

Libraries
---------
- [The `is_power_of_two` method on unsigned numeric types is now a `const` function.][65092]

Stabilized APIs
---------------
- [`BTreeMap::get_key_value`]
- [`HashMap::get_key_value`]
- [`Option::as_deref_mut`]
- [`Option::as_deref`]
- [`Option::flatten`]
- [`UdpSocket::peer_addr`]
- [`f32::to_be_bytes`]
- [`f32::to_le_bytes`]
- [`f32::to_ne_bytes`]
- [`f64::to_be_bytes`]
- [`f64::to_le_bytes`]
- [`f64::to_ne_bytes`]
- [`f32::from_be_bytes`]
- [`f32::from_le_bytes`]
- [`f32::from_ne_bytes`]
- [`f64::from_be_bytes`]
- [`f64::from_le_bytes`]
- [`f64::from_ne_bytes`]
- [`mem::take`]
- [`slice::repeat`]
- [`todo!`]

Cargo
-----
- [Cargo will now always display warnings, rather than only on
  fresh builds.][cargo/7450]
- [Feature flags (except `--all-features`) passed to a virtual workspace will
  now produce an error.][cargo/7507] Previously these flags were ignored.
- [You can now publish `dev-dependencies` without including
  a `version`.][cargo/7333]

Misc
----
- [You can now specify the `#[cfg(doctest)]` attribute to include an item only
  when running documentation tests with `rustdoc`.][63803]

Compatibility Notes
-------------------
- [As previously announced, any previous NLL warnings in the 2015 edition are
  now hard errors.][64221]
- [The `include!` macro will now warn if it failed to include the
  entire file.][64284] The `include!` macro unintentionally only includes the
  first _expression_ in a file, and this can be unintuitive. This will become
  either a hard error in a future release, or the behavior may be fixed to include all expressions as expected.
- [Using `#[inline]` on function prototypes and consts now emits a warning under
  `unused_attribute` lint.][65294] Using `#[inline]` anywhere else inside traits
  or `extern` blocks now correctly emits a hard error.

[65294]: rust-lang/rust#65294
[66103]: rust-lang/rust#66103
[65843]: rust-lang/rust#65843
[65188]: rust-lang/rust#65188
[65092]: rust-lang/rust#65092
[64589]: rust-lang/rust#64589
[64639]: rust-lang/rust#64639
[64221]: rust-lang/rust#64221
[64284]: rust-lang/rust#64284
[63931]: rust-lang/rust#63931
[64035]: rust-lang/rust#64035
[63674]: rust-lang/rust#63674
[63803]: rust-lang/rust#63803
[cargo/7450]: rust-lang/cargo#7450
[cargo/7507]: rust-lang/cargo#7507
[cargo/7525]: rust-lang/cargo#7525
[cargo/7333]: rust-lang/cargo#7333
[(rfc 2008)]: https://rust-lang.github.io/rfcs/2008-non-exhaustive.html
[`f32::to_be_bytes`]: https://doc.rust-lang.org/std/primitive.f32.html#method.to_be_bytes
[`f32::to_le_bytes`]: https://doc.rust-lang.org/std/primitive.f32.html#method.to_le_bytes
[`f32::to_ne_bytes`]: https://doc.rust-lang.org/std/primitive.f32.html#method.to_ne_bytes
[`f64::to_be_bytes`]: https://doc.rust-lang.org/std/primitive.f64.html#method.to_be_bytes
[`f64::to_le_bytes`]: https://doc.rust-lang.org/std/primitive.f64.html#method.to_le_bytes
[`f64::to_ne_bytes`]: https://doc.rust-lang.org/std/primitive.f64.html#method.to_ne_bytes
[`f32::from_be_bytes`]: https://doc.rust-lang.org/std/primitive.f32.html#method.from_be_bytes
[`f32::from_le_bytes`]: https://doc.rust-lang.org/std/primitive.f32.html#method.from_le_bytes
[`f32::from_ne_bytes`]: https://doc.rust-lang.org/std/primitive.f32.html#method.from_ne_bytes
[`f64::from_be_bytes`]: https://doc.rust-lang.org/std/primitive.f64.html#method.from_be_bytes
[`f64::from_le_bytes`]: https://doc.rust-lang.org/std/primitive.f64.html#method.from_le_bytes
[`f64::from_ne_bytes`]: https://doc.rust-lang.org/std/primitive.f64.html#method.from_ne_bytes
[`option::flatten`]: https://doc.rust-lang.org/std/option/enum.Option.html#method.flatten
[`option::as_deref`]: https://doc.rust-lang.org/std/option/enum.Option.html#method.as_deref
[`option::as_deref_mut`]: https://doc.rust-lang.org/std/option/enum.Option.html#method.as_deref_mut
[`hashmap::get_key_value`]: https://doc.rust-lang.org/std/collections/struct.HashMap.html#method.get_key_value
[`btreemap::get_key_value`]: https://doc.rust-lang.org/std/collections/struct.BTreeMap.html#method.get_key_value
[`slice::repeat`]: https://doc.rust-lang.org/std/primitive.slice.html#method.repeat
[`mem::take`]: https://doc.rust-lang.org/std/mem/fn.take.html
[`udpsocket::peer_addr`]: https://doc.rust-lang.org/std/net/struct.UdpSocket.html#method.peer_addr
[`todo!`]: https://doc.rust-lang.org/std/macro.todo.html
netbsd-srcmastr pushed a commit to NetBSD/pkgsrc that referenced this pull request Jan 14, 2020
Version 1.40.0 (2019-12-19)
===========================

Language
--------
- [You can now use tuple `struct`s and tuple `enum` variant's constructors in
  `const` contexts.][65188] e.g.

  ```rust
  pub struct Point(i32, i32);

  const ORIGIN: Point = {
      let constructor = Point;

      constructor(0, 0)
  };
  ```

- [You can now mark `struct`s, `enum`s, and `enum` variants with the `#[non_exhaustive]` attribute to
  indicate that there may be variants or fields added in the future.][64639]
  For example this requires adding a wild-card branch (`_ => {}`) to any match
  statements on a non-exhaustive `enum`. [(RFC 2008)]
- [You can now use function-like procedural macros in `extern` blocks and in
  type positions.][63931] e.g. `type Generated = macro!();`
- [Function-like and attribute procedural macros can now emit
  `macro_rules!` items, so you can now have your macros generate macros.][64035]
- [The `meta` pattern matcher in `macro_rules!` now correctly matches the modern
  attribute syntax.][63674] For example `(#[$m:meta])` now matches `#[attr]`,
  `#[attr{tokens}]`, `#[attr[tokens]]`, and `#[attr(tokens)]`.

Compiler
--------
- [Added tier 3 support\* for the
  `thumbv7neon-unknown-linux-musleabihf` target.][66103]
- [Added tier 3 support for the
  `aarch64-unknown-none-softfloat` target.][64589]
- [Added tier 3 support for the `mips64-unknown-linux-muslabi64`, and
  `mips64el-unknown-linux-muslabi64` targets.][65843]

\* Refer to Rust's [platform support page][forge-platform-support] for more
  information on Rust's tiered platform support.

Libraries
---------
- [The `is_power_of_two` method on unsigned numeric types is now a `const` function.][65092]

Stabilized APIs
---------------
- [`BTreeMap::get_key_value`]
- [`HashMap::get_key_value`]
- [`Option::as_deref_mut`]
- [`Option::as_deref`]
- [`Option::flatten`]
- [`UdpSocket::peer_addr`]
- [`f32::to_be_bytes`]
- [`f32::to_le_bytes`]
- [`f32::to_ne_bytes`]
- [`f64::to_be_bytes`]
- [`f64::to_le_bytes`]
- [`f64::to_ne_bytes`]
- [`f32::from_be_bytes`]
- [`f32::from_le_bytes`]
- [`f32::from_ne_bytes`]
- [`f64::from_be_bytes`]
- [`f64::from_le_bytes`]
- [`f64::from_ne_bytes`]
- [`mem::take`]
- [`slice::repeat`]
- [`todo!`]

Cargo
-----
- [Cargo will now always display warnings, rather than only on
  fresh builds.][cargo/7450]
- [Feature flags (except `--all-features`) passed to a virtual workspace will
  now produce an error.][cargo/7507] Previously these flags were ignored.
- [You can now publish `dev-dependencies` without including
  a `version`.][cargo/7333]

Misc
----
- [You can now specify the `#[cfg(doctest)]` attribute to include an item only
  when running documentation tests with `rustdoc`.][63803]

Compatibility Notes
-------------------
- [As previously announced, any previous NLL warnings in the 2015 edition are
  now hard errors.][64221]
- [The `include!` macro will now warn if it failed to include the
  entire file.][64284] The `include!` macro unintentionally only includes the
  first _expression_ in a file, and this can be unintuitive. This will become
  either a hard error in a future release, or the behavior may be fixed to include all expressions as expected.
- [Using `#[inline]` on function prototypes and consts now emits a warning under
  `unused_attribute` lint.][65294] Using `#[inline]` anywhere else inside traits
  or `extern` blocks now correctly emits a hard error.

[65294]: rust-lang/rust#65294
[66103]: rust-lang/rust#66103
[65843]: rust-lang/rust#65843
[65188]: rust-lang/rust#65188
[65092]: rust-lang/rust#65092
[64589]: rust-lang/rust#64589
[64639]: rust-lang/rust#64639
[64221]: rust-lang/rust#64221
[64284]: rust-lang/rust#64284
[63931]: rust-lang/rust#63931
[64035]: rust-lang/rust#64035
[63674]: rust-lang/rust#63674
[63803]: rust-lang/rust#63803
[cargo/7450]: rust-lang/cargo#7450
[cargo/7507]: rust-lang/cargo#7507
[cargo/7525]: rust-lang/cargo#7525
[cargo/7333]: rust-lang/cargo#7333
[(rfc 2008)]: https://rust-lang.github.io/rfcs/2008-non-exhaustive.html
[`f32::to_be_bytes`]: https://doc.rust-lang.org/std/primitive.f32.html#method.to_be_bytes
[`f32::to_le_bytes`]: https://doc.rust-lang.org/std/primitive.f32.html#method.to_le_bytes
[`f32::to_ne_bytes`]: https://doc.rust-lang.org/std/primitive.f32.html#method.to_ne_bytes
[`f64::to_be_bytes`]: https://doc.rust-lang.org/std/primitive.f64.html#method.to_be_bytes
[`f64::to_le_bytes`]: https://doc.rust-lang.org/std/primitive.f64.html#method.to_le_bytes
[`f64::to_ne_bytes`]: https://doc.rust-lang.org/std/primitive.f64.html#method.to_ne_bytes
[`f32::from_be_bytes`]: https://doc.rust-lang.org/std/primitive.f32.html#method.from_be_bytes
[`f32::from_le_bytes`]: https://doc.rust-lang.org/std/primitive.f32.html#method.from_le_bytes
[`f32::from_ne_bytes`]: https://doc.rust-lang.org/std/primitive.f32.html#method.from_ne_bytes
[`f64::from_be_bytes`]: https://doc.rust-lang.org/std/primitive.f64.html#method.from_be_bytes
[`f64::from_le_bytes`]: https://doc.rust-lang.org/std/primitive.f64.html#method.from_le_bytes
[`f64::from_ne_bytes`]: https://doc.rust-lang.org/std/primitive.f64.html#method.from_ne_bytes
[`option::flatten`]: https://doc.rust-lang.org/std/option/enum.Option.html#method.flatten
[`option::as_deref`]: https://doc.rust-lang.org/std/option/enum.Option.html#method.as_deref
[`option::as_deref_mut`]: https://doc.rust-lang.org/std/option/enum.Option.html#method.as_deref_mut
[`hashmap::get_key_value`]: https://doc.rust-lang.org/std/collections/struct.HashMap.html#method.get_key_value
[`btreemap::get_key_value`]: https://doc.rust-lang.org/std/collections/struct.BTreeMap.html#method.get_key_value
[`slice::repeat`]: https://doc.rust-lang.org/std/primitive.slice.html#method.repeat
[`mem::take`]: https://doc.rust-lang.org/std/mem/fn.take.html
[`udpsocket::peer_addr`]: https://doc.rust-lang.org/std/net/struct.UdpSocket.html#method.peer_addr
[`todo!`]: https://doc.rust-lang.org/std/macro.todo.html
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Using #[inline] on function prototype should emit a warning
9 participants