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

chore: remove *all* extern crate statements #1738

Merged
merged 6 commits into from
Nov 21, 2021
Merged

Conversation

hawkw
Copy link
Member

@hawkw hawkw commented Nov 21, 2021

Depends on #1737

This branch removes all remaining extern crate statements. Most of
these are in old code and were not removed when updating to Rust 2018.
Whoops!

Our MSRV no longer requires extern crate, so we don't need these. The
exception is extern crate statements for std and alloc, which are
still the way these libraries are included explicitly when building for
no_std platforms.

In some cases, the tests had to explicitly import the span! and
event! macros at every use, because their names conflict with the
span and event modules in the test support code. Oh well.

Some of the examples still include `#[macro_use] extern crate`
statements for importing macros from `tracing` or `tracing-core`. On a
recent nightly, this results in import conflicts with the implicit
import of the documented crate in doctests:
https://github.com/tokio-rs/tracing/runs/4279736243?check_suite_focus=true

This commit removes all the `extern crate` statements from doctests. Our
MSRV is new enough that `extern crate` is not required on any of the Rust
versions we support.

Signed-off-by: Eliza Weisman <[email protected]>
Depends on #1737

This branch removes all remaining `extern crate` statements. Most of
these are in old code and were not removed when updating to Rust 2018.
Whoops!

Our MSRV no longer requires `extern crate`, so we don't need these. The
exception is `extern crate` statements for `std` and `alloc`, which are
still the way these libraries are included explicitly when building for
`no_std` platforms.

In some cases, the tests had to explicitly import the `span!` and
`event!` macros at every use, because their names conflict with the
`span` and `event` modules in the test support code. Oh well.
@hawkw hawkw requested review from carllerche, davidbarsky and a team as code owners November 21, 2021 20:11
Signed-off-by: Eliza Weisman <[email protected]>
@hawkw hawkw force-pushed the eliza/nuke-all-extern-crates branch from 4cbb083 to 86d9d13 Compare November 21, 2021 20:20
Base automatically changed from eliza/no-extern-crates to master November 21, 2021 20:20
@hawkw hawkw merged commit f1aa0d4 into master Nov 21, 2021
@hawkw hawkw deleted the eliza/nuke-all-extern-crates branch November 21, 2021 23:19
hawkw added a commit that referenced this pull request Dec 2, 2021
Depends on #1737

This branch removes all remaining `extern crate` statements. Most of
these are in old code and were not removed when updating to Rust 2018.
Whoops!

Our MSRV no longer requires `extern crate`, so we don't need these. The
exception is `extern crate` statements for `std` and `alloc`, which are
still the way these libraries are included explicitly when building for
`no_std` platforms.

In some cases, the tests had to explicitly import the `span!` and
`event!` macros at every use, because their names conflict with the
`span` and `event` modules in the test support code. Oh well.

Signed-off-by: Eliza Weisman <[email protected]>
@hawkw hawkw mentioned this pull request Dec 2, 2021
hawkw added a commit that referenced this pull request Dec 19, 2021
Depends on #1737

This branch removes all remaining `extern crate` statements. Most of
these are in old code and were not removed when updating to Rust 2018.
Whoops!

Our MSRV no longer requires `extern crate`, so we don't need these. The
exception is `extern crate` statements for `std` and `alloc`, which are
still the way these libraries are included explicitly when building for
`no_std` platforms.

In some cases, the tests had to explicitly import the `span!` and
`event!` macros at every use, because their names conflict with the
`span` and `event` modules in the test support code. Oh well.

Signed-off-by: Eliza Weisman <[email protected]>
hawkw added a commit that referenced this pull request Dec 19, 2021
Depends on #1737

This branch removes all remaining `extern crate` statements. Most of
these are in old code and were not removed when updating to Rust 2018.
Whoops!

Our MSRV no longer requires `extern crate`, so we don't need these. The
exception is `extern crate` statements for `std` and `alloc`, which are
still the way these libraries are included explicitly when building for
`no_std` platforms.

In some cases, the tests had to explicitly import the `span!` and
`event!` macros at every use, because their names conflict with the
`span` and `event` modules in the test support code. Oh well.

Signed-off-by: Eliza Weisman <[email protected]>
hawkw added a commit that referenced this pull request Dec 20, 2021
Depends on #1737

This branch removes all remaining `extern crate` statements. Most of
these are in old code and were not removed when updating to Rust 2018.
Whoops!

Our MSRV no longer requires `extern crate`, so we don't need these. The
exception is `extern crate` statements for `std` and `alloc`, which are
still the way these libraries are included explicitly when building for
`no_std` platforms.

In some cases, the tests had to explicitly import the `span!` and
`event!` macros at every use, because their names conflict with the
`span` and `event` modules in the test support code. Oh well.

Signed-off-by: Eliza Weisman <[email protected]>
kaffarell pushed a commit to kaffarell/tracing that referenced this pull request May 22, 2024
Depends on tokio-rs#1737

This branch removes all remaining `extern crate` statements. Most of
these are in old code and were not removed when updating to Rust 2018.
Whoops!

Our MSRV no longer requires `extern crate`, so we don't need these. The
exception is `extern crate` statements for `std` and `alloc`, which are
still the way these libraries are included explicitly when building for
`no_std` platforms.

In some cases, the tests had to explicitly import the `span!` and
`event!` macros at every use, because their names conflict with the
`span` and `event` modules in the test support code. Oh well.

Signed-off-by: Eliza Weisman <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants