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

Rollup of 10 pull requests #83149

Merged
merged 33 commits into from
Mar 15, 2021
Merged

Rollup of 10 pull requests #83149

merged 33 commits into from
Mar 15, 2021

Conversation

Dylan-DPC-zz
Copy link

Successful merges:

Failed merges:

r? @ghost
@rustbot modify labels: rollup

Create a similar rollup

tmiasko and others added 30 commits March 11, 2021 16:04
This change makes it easier to follow the control flow.

I also moved the end-of-line comments attached to some symbols to before
the symbol listing. This allows rustfmt to format the code; otherwise no
formatting occurs (see rust-lang/rustfmt#4750).
E.g., `#[doc(123)]`.
"crate level attribute" -> "crate-level attribute"
It seems there are two copies of it: one in `src/test/ui/attributes/`
and one in `src/test/rustdoc-ui/`. I'm guessing this is to test that the
lint is emitted both when you run the compiler and when you run rustdoc.
Found while investigating rust-lang#82933 - all LocalDefIds are expected to have
HirIds, there's no point in pretending otherwise.
Merges `if-let` and `if x.is_some() { ... }` blocks
- Tweak lint message
- Display multi-segment paths correctly
Fixes rust-lang#83112

The location information for a dummy span isn't real, so don't encode
it. This brings the incr comp cache code into line with the Span
`StableHash` impl, which doesn't hash the location information for dummy
spans.

Previously, we would attempt to load the 'original' file from a dummy
span - if the file id changed (e.g. due to being moved on disk), we would get an
ICE, since the Span was still valid due to its hash being unchanged.
Now that future-incompat-report support has landed in nightly Cargo, we
can start to make progress towards removing the various proc-macro
back-compat hacks that have accumulated in the compiler.

This PR introduces a new lint `proc_macro_back_compat`, which results in
a future-incompat-report entry being generated. All proc-macro
back-compat warnings will be grouped under this lint. Note that this
lint will never actually become a hard error - instead, we will remove
the special cases for various macros, which will cause older versions of
those crates to emit some other error.

I've added code to fire this lint for the `time-macros-impl` case. This
is the easiest case out of all of our current back-compat hacks - the
crate was renamed to `time-macros`, so seeing a filename with
`time-macros-impl` guarantees that an older version of the parent `time`
crate is in use.

When Cargo's future-incompat-report feature gets stabilized, affected
users will start to see future-incompat warnings when they build their
crates.
This detects all Java literal types and all single word C data types,
and suggests the corresponding Rust literal type.
… r=varkor

Custom error on literal names from other languages

This detects all Java literal types and all single word C data types, and suggests the corresponding Rust literal type.
…ange, r=davidtwco

Validate rustc_layout_scalar_valid_range_{start,end} attributes

Fixes rust-lang#82251, fixes rust-lang#82981.
…dtwco

Find more invalid doc attributes

- Lint on `#[doc(123)]`, `#[doc("hello")]`, etc.
- Lint every attribute; e.g., will now report two warnings for `#[doc(foo, bar)]`
- Add hyphen to "crate level"
- Display paths like `#[doc(foo::bar)]` correctly instead of as an empty string
Remove unused `opt_local_def_id_to_hir_id` function

Found while investigating rust-lang#82933 - all LocalDefIds are expected to have
HirIds, there's no point in pretending otherwise.
Fix typos in `library/core/src/ptr/mod.rs` and `library/std/src/sys_common/thread_local_dtor.rs`

adress -> address
…as-schievink

Minor refactoring in try_index_step

Merges `if-let` and `if x.is_some() { ... }` blocks
…petrochenkov

Introduce `proc_macro_back_compat` lint, and emit for `time-macros-impl`

Now that future-incompat-report support has landed in nightly Cargo, we
can start to make progress towards removing the various proc-macro
back-compat hacks that have accumulated in the compiler.

This PR introduces a new lint `proc_macro_back_compat`, which results in
a future-incompat-report entry being generated. All proc-macro
back-compat warnings will be grouped under this lint. Note that this
lint will never actually become a hard error - instead, we will remove
the special cases for various macros, which will cause older versions of
those crates to emit some other error.

I've added code to fire this lint for the `time-macros-impl` case. This
is the easiest case out of all of our current back-compat hacks - the
crate was renamed to `time-macros`, so seeing a filename with
`time-macros-impl` guarantees that an older version of the parent `time`
crate is in use.

When Cargo's future-incompat-report feature gets stabilized, affected
users will start to see future-incompat warnings when they build their
crates.
…stebank

Don't encode file information for span with a dummy location

Fixes rust-lang#83112

The location information for a dummy span isn't real, so don't encode
it. This brings the incr comp cache code into line with the Span
`StableHash` impl, which doesn't hash the location information for dummy
spans.

Previously, we would attempt to load the 'original' file from a dummy
span - if the file id changed (e.g. due to being moved on disk), we would get an
ICE, since the Span was still valid due to its hash being unchanged.
Introduce `rustc_interface::interface::Config::parse_sess_created` callback

Resolves rust-lang#82900.

cc `@oli-obk`
@rustbot rustbot added the rollup A PR which is a rollup label Mar 15, 2021
@Dylan-DPC-zz
Copy link
Author

@bors r+ rollup=never p=5

@bors
Copy link
Contributor

bors commented Mar 15, 2021

📌 Commit 2816c11 has been approved by Dylan-DPC

@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 Mar 15, 2021
@bors
Copy link
Contributor

bors commented Mar 15, 2021

⌛ Testing commit 2816c11 with merge 2ccf063...

@bors
Copy link
Contributor

bors commented Mar 15, 2021

☀️ Test successful - checks-actions
Approved by: Dylan-DPC
Pushing 2ccf063 to master...

@bors bors added the merged-by-bors This PR was explicitly merged by bors. label Mar 15, 2021
@bors bors merged commit 2ccf063 into rust-lang:master Mar 15, 2021
@rustbot rustbot added this to the 1.52.0 milestone Mar 15, 2021
klensy added a commit to klensy/rust that referenced this pull request Apr 8, 2022
check_doc_alias_value: get argument as Symbol to prevent needless string convertions

check_doc_attrs: don't alloc vec, iterate over slice. Vec introduced in rust-lang#83149, but no perf run posted on merge

replace as_str() check with symbol check

get_single_str_from_tts: don't prealloc string

trivial string to str replace

LifetimeScopeForPath::NonElided use Vec<Symbol> instead of Vec<String>

AssertModuleSource use BTreeSet<Symbol> instead of BTreeSet<String>

CrateInfo.crate_name replace FxHashMap<CrateNum, String> with FxHashMap<CrateNum, Symbol>
bjorn3 pushed a commit to bjorn3/rust that referenced this pull request Apr 22, 2022
check_doc_alias_value: get argument as Symbol to prevent needless string convertions

check_doc_attrs: don't alloc vec, iterate over slice. Vec introduced in rust-lang#83149, but no perf run posted on merge

replace as_str() check with symbol check

get_single_str_from_tts: don't prealloc string

trivial string to str replace

LifetimeScopeForPath::NonElided use Vec<Symbol> instead of Vec<String>

AssertModuleSource use BTreeSet<Symbol> instead of BTreeSet<String>

CrateInfo.crate_name replace FxHashMap<CrateNum, String> with FxHashMap<CrateNum, Symbol>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
merged-by-bors This PR was explicitly merged by bors. rollup A PR which is a rollup S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion.
Projects
None yet
Development

Successfully merging this pull request may close these issues.