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 7 pull requests #95827

Closed
wants to merge 22 commits into from
Closed

Conversation

Dylan-DPC
Copy link
Member

Successful merges:

Failed merges:

r? @ghost
@rustbot modify labels: rollup

Create a similar rollup

compiler-errors and others added 22 commits April 6, 2022 21:27
Otherwise we can't use println!() within atexit handlers etc.
This avoids 'unused unsafe' warnings when using this feature inside std.
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>
… test it

* split `fuzzy_provenance_casts` into a ptr2int and a int2ptr lint
* feature gate both lints
* update documentation to be more realistic short term
* add tests for these lints
…chaelwoerister

Strict provenance lints

See rust-lang#95488.
This PR introduces two unstable (allow by default) lints to which lint on int2ptr and ptr2int casts, as the former is not possible in the strict provenance model and the latter can be written nicer using the `.addr()` API.
Based on an initial version of the lint by `@Gankra` in rust-lang#95199.
refactor: simplify few string related interactions

Few small optimizations:

check_doc_keyword: don't alloc string for emptiness check
check_doc_alias_value: get argument as Symbol to prevent needless string convertions
check_doc_attrs: don't alloc vec, iterate over slice.
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 FxHashSet<Symbol> instead of BTreeSet<String>
CrateInfo.crate_name replace FxHashMap<CrateNum, String> with FxHashMap<CrateNum, Symbol>
…nieu

Replace ReentrantMutex by a futex-based one on Linux.

Tracking issue: rust-lang#93740

r? `@Amanieu`
Don't report numeric inference ambiguity when we have previous errors

Fixes rust-lang#95648
[macro_metavar_expr] Add tests to ensure the feature requirement

These tests should have been added in the initial implementation they were unintentionally forgotten

cc rust-lang#83527
r? ```@petrochenkov```
…th-backline, r=notriddle

rustdoc: Fix empty doc comment with backline ICE

Fixes rust-lang#95800.

r? `@notriddle`
…=GuillaumeGomez

Remove extra space before a where clause

Remove extra space before where clause in the generated documentation.

The fix is to move the space before the break-line so that it doesn't appear visually but is still here. Removing it completely would create things like this `impl<D> Delta<D>where D: MyTrait` (missing a space before the where) which I don't think we want.

Added two regression test, first one test that the `<br>` is after the space and the second check that the `<br>` is before the spaces.

Before:
![image](https://user-images.githubusercontent.com/3616612/162475212-d4bb6727-ed66-4a55-a4a2-4f55189bf8bd.png)

After:
![image](https://user-images.githubusercontent.com/3616612/162475467-508fd082-60a7-4a8c-b693-8b188e8843e6.png)

r? `@GuillaumeGomez`
@rustbot rustbot added T-compiler Relevant to the compiler team, which will review and decide on the PR/issue. T-rustdoc Relevant to the rustdoc team, which will review and decide on the PR/issue. rollup A PR which is a rollup labels Apr 8, 2022
@Dylan-DPC
Copy link
Member Author

@bors r+ rollup=never p=5

@bors
Copy link
Contributor

bors commented Apr 8, 2022

📌 Commit 00c3d88 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 Apr 8, 2022
@bors
Copy link
Contributor

bors commented Apr 8, 2022

⌛ Testing commit 00c3d88 with merge 152e328ffc326614658b880fb695cb79130c98d6...

@rust-log-analyzer
Copy link
Collaborator

The job test-various failed! Check out the build log: (web) (plain)

Click to see the possible cause of the failure (guessed by this bot)
[RUSTC-TIMING] gimli test:false 4.406
[RUSTC-TIMING] object test:false 4.421
warning: dropping unsupported crate type `dylib` for target `wasm32-unknown-unknown`

error: use of mutable static is unsafe and requires unsafe block (error E0133)
    |
148 | / macro_rules! thread_local {
149 | |     // empty (base case for the recursion)
150 | |     () => {};
150 | |     () => {};
151 | |
...   |
158 | |         $crate::__thread_local_inner!($(#[$attr])* $vis $name, $t, const $init);
...   |
170 | |     );
171 | | }
    | |_- in this expansion of `thread_local!` (#1)
    | |_- in this expansion of `thread_local!` (#1)
...
178 |   macro_rules! __thread_local_inner {
    |  _-
    | |_|
    | |
179 | |     // used to generate the `LocalKey` value for const-initialized thread locals
180 | |     (@key $t:ty, const $init:expr) => {{
181 | |         #[cfg_attr(not(windows), inline(always))] // see comments below
...   |
197 | |                 $crate::option::Option::Some(&VAL)
    | |                                              ^^^^ use of mutable static
...   |
363 | |             $crate::__thread_local_inner!(@key $t, $($init)*);
364 | |     }
365 | | }
    | | -
    | |_|
    | |_|
    | |_in this expansion of `$crate::__thread_local_inner!` (#2)
    |   in this expansion of `$crate::__thread_local_inner!` (#3)
   ::: library/std/src/sys_common/thread_info.rs:13:1
    |
    |
13  |   thread_local! { static THREAD_INFO: RefCell<Option<ThreadInfo>> = const { RefCell::new(None) } }
    |
note: the lint level is defined here
   --> library/std/src/thread/local.rs:182:16
    |
    |
148 | / macro_rules! thread_local {
149 | |     // empty (base case for the recursion)
150 | |     () => {};
151 | |
...   |
158 | |         $crate::__thread_local_inner!($(#[$attr])* $vis $name, $t, const $init);
...   |
170 | |     );
171 | | }
    | |_- in this expansion of `thread_local!` (#1)
    | |_- in this expansion of `thread_local!` (#1)
...
178 |   macro_rules! __thread_local_inner {
    |  _-
    | |_|
    | |
179 | |     // used to generate the `LocalKey` value for const-initialized thread locals
180 | |     (@key $t:ty, const $init:expr) => {{
181 | |         #[cfg_attr(not(windows), inline(always))] // see comments below
182 | |         #[deny(unsafe_op_in_unsafe_fn)]
...   |
...   |
363 | |             $crate::__thread_local_inner!(@key $t, $($init)*);
364 | |     }
365 | | }
    | | -
    | |_|
    | |_|
    | |_in this expansion of `$crate::__thread_local_inner!` (#2)
    |   in this expansion of `$crate::__thread_local_inner!` (#3)
   ::: library/std/src/sys_common/thread_info.rs:13:1
    |
    |
13  |   thread_local! { static THREAD_INFO: RefCell<Option<ThreadInfo>> = const { RefCell::new(None) } }
    |   ------------------------------------------------------------------------------------------------ in this macro invocation (#1)
    = note: mutable statics can be mutated by multiple threads: aliasing violations or data races will cause undefined behavior
[RUSTC-TIMING] std test:false 2.655
warning: `std` (lib) generated 1 warning
error: could not compile `std` due to previous error; 1 warning emitted
Build completed unsuccessfully in 0:10:51

@bors
Copy link
Contributor

bors commented Apr 8, 2022

💔 Test failed - checks-actions

@bors bors added S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. and removed S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. labels Apr 8, 2022
@Dylan-DPC Dylan-DPC closed this Apr 9, 2022
@Dylan-DPC Dylan-DPC deleted the rollup-c4mbqoz branch April 9, 2022 20:32
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
rollup A PR which is a rollup S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue. T-rustdoc Relevant to the rustdoc team, which will review and decide on the PR/issue.
Projects
None yet
Development

Successfully merging this pull request may close these issues.