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 17 pull requests #74455

Closed
wants to merge 58 commits into from

Conversation

Manishearth
Copy link
Member

Successful merges:

Failed merges:

r? @ghost

estebank and others added 30 commits June 28, 2020 16:08
Might be subject to the birthday paradox occasionally, causing spurious failures.

Addresses: rust-lang#70740 (review)
Because the old one is harder to read and confuse typing checkers.
As a none-native speaker I stumbled upon this, looked it up and couldn't find a phrase, so I made my own assumption that "in any way" was meant (which is the meaning I would've deduced anyway)
…ttribute-check, r=Mark-Simulacrum

Enforce even more the code blocks attributes check through rustdoc

`rustdoc` now has a lint which allows it to warn if a code block attribute is malformated (which can end up in bad situations, even more in case of testing examples!). Now it'll fail if such a situation is encountered when testing markdown code blocks examples.

r? @Mark-Simulacrum
…time, r=nikomatsakis

Detect when `'static` obligation might come from an `impl`

Partly address rust-lang#71341.
Make some Option methods const

Tracking issue: rust-lang#67441

Constantify the following methods of `Option`:
- `as_ref`
- `is_some`
- `is_none`
- `iter` (not sure about this one, but it is possible, and will be useful when const traits are a thing)

cc @rust-lang/wg-const-eval @rust-lang/libs
…atsakis

Fix MinGW `run-make-fulldeps` tests

`compiler-rt-works-on-mingw` and `libs-search-path` were not ran because `only-mingw` doesn't match any target.
Enabled and verified few ignored tests with `windows-gnu` toolchain. They are still ignored on MSVC since I'm not experienced with this target.
…nts-as-str, r=Amanieu

Add Arguments::as_str().

There exist quite a few macros in the Rust ecosystem which use `format_args!()` for formatting, but special case the one-argument case for optimization:

```rust
#[macro_export]
macro_rules! some_macro {
    ($s:expr) => { /* print &str directly, no formatting, no buffers */ };
    ($s:expr, $($tt:tt)*) => { /* use format_args to write to a buffer first */ }
}
```

E.g. [here](https://github.com/rust-embedded/cortex-m-semihosting/blob/7a961f0fbe6eb1b29a7ebde4bad4b9cf5f842b31/src/macros.rs#L48-L58), [here](https://github.com/rust-lang-nursery/failure/blob/20f9a9e223b7cd71aed541d050cc73a747fc00c4/src/macros.rs#L9-L17), and [here](https://github.com/fusion-engineering/px4-rust/blob/7b679cd6da9ffd95f36f6526d88345f8b36121da/px4/src/logging.rs#L45-L52).

The problem with these is that a forgotten argument such as in `some_macro!("{}")` will not be diagnosed, but just prints `"{}"`.

With this PR, it is possible to handle the no-arguments case separately *after* `format_args!()`, while simplifying the macro. Then these macros can give the proper error about a missing argument, just like `print!("{}")` does, while still using the same optimized implementation as before.

This is even more important with [RFC 2795](rust-lang/rfcs#2795), to make sure `some_macro!("{some_variable}")` works as expected.
…r=Mark-Simulacrum

Teach bootstrap about target files vs target triples

`rustc` allows passing in predefined target triples as well as JSON
target specification files. This change allows bootstrap to have the
first inkling about those differences. This allows building a
cross-compiler for an out-of-tree architecture (even though that
compiler won't work for other reasons).

Even if no one ever uses this functionality, I think the newtype
around the `Interned<String>` improves the readability of the code.
Fix src/test/run-make/static-pie/test-aslr.rs

Might be subject to the birthday paradox occasionally, causing spurious failures.

Addresses: rust-lang#70740 (review)
Use intra-doc links in core::iter module

This will make core::iter doc depend less on std doc.
add lazy normalization regression tests

We previously didn't have simple tests which fail if we aren't careful around lazy normalization.

We now do.
…r=spastorino

Remove leftover from emscripten fastcomp support

This is no longer used since rust-lang#63649
…hewjasper

Don't assign `()` to `!` MIR locals

Implements the fix described in rust-lang#73860 (comment).

Fixes rust-lang#73860

r? @matthewjasper
…i-obk

Use an UTF-8 locale for the linker.

Using a `C` locale breaks unicode filenames on Guix, where the linker is wrapped by a Guile program.
…onas-schievink

docs: better demonstrate that None values are skipped as many times a…

…s needed
Fix Arc::as_ptr docs

As a non-native speaker I stumbled upon this, looked it up and couldn't find a phrase, so I made my own assumption that "in any way" was meant (which is the meaning I would've deduced anyway)
…ns-boxes, r=davidtwco

improper_ctypes_definitions: allow `Box`

Addresses rust-lang#72700 (comment).

This PR stops linting against `Box` in `extern "C" fn`s for the `improper_ctypes_definitions` lint - boxes are documented to be FFI-safe.

cc @alexcrichton @CryZe
Fix `Safety` docs for `from_raw_parts_mut`

This aligns the wording more with the documentation of e.g. `drop_in_place`, `replace`, `swap` and `swap_nonoverlapping` from `core::ptr`.

Also if the pointer were really only valid for writes, it would be trivial to introduce UB from safe code, after calling `core::slice::from_raw_parts_mut`.
@Manishearth
Copy link
Member Author

@rustbot modify labels: +rollup
@bors r+ rollup=never p=5

@rustbot rustbot added the rollup A PR which is a rollup label Jul 17, 2020
@bors
Copy link
Contributor

bors commented Jul 17, 2020

📌 Commit f94926a has been approved by Manishearth

@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 Jul 17, 2020
@bors
Copy link
Contributor

bors commented Jul 17, 2020

⌛ Testing commit f94926a with merge 7589ee9493edf2c3f620b54a5a48e0f55a6fa206...

@bors
Copy link
Contributor

bors commented Jul 17, 2020

💔 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 Jul 17, 2020
@Manishearth
Copy link
Member Author

2020-07-17T20:40:36.9472277Z [TIMING] ToolBuild { compiler: Compiler { stage: 0, host: TargetSelection { triple: "x86_64-unknown-linux-gnu", file: None } }, target: TargetSelection { triple: "x86_64-unknown-linux-gnu", file: None }, tool: "tidy", path: "src/tools/tidy", mode: ToolBootstrap, is_optional_tool: false, source_type: InTree, extra_features: [] } -- 23.054
2020-07-17T20:40:36.9474901Z tidy check
2020-07-17T20:40:38.0640507Z tidy error: duplicate error code: 767
2020-07-17T20:40:38.0641721Z tidy error: /checkout/src/librustc_error_codes/error_codes.rs:452: E0767: include_str!("./error_codes/E0767.md"),
2020-07-17T20:40:38.0643363Z tidy error: /checkout/src/librustc_error_codes/error_codes.rs:635:     E0767, // `'static' obligation coming from `impl dyn Trait {}` or `impl Foo for dyn Bar {}`.
2020-07-17T20:40:41.1402204Z Checking which error codes lack tests...
2020-07-17T20:40:41.3199217Z some tidy checks failed
2020-07-17T20:40:41.3199568Z Found 509 error codes
2020-07-17T20:40:41.3199840Z Found 0 error codes with no tests\

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.
Projects
None yet
Development

Successfully merging this pull request may close these issues.