Skip to content
This repository has been archived by the owner on Jan 7, 2022. It is now read-only.

sync upstream #147

Merged
merged 753 commits into from
Nov 24, 2020
Merged

sync upstream #147

merged 753 commits into from
Nov 24, 2020

Conversation

vext01
Copy link
Member

@vext01 vext01 commented Nov 23, 2020

No description provided.

GuillaumeGomez and others added 30 commits November 17, 2020 10:33
If the LLVM was externally provided, then we don't currently copy artifacts into
the sysroot. This is not necessarily the right choice (in particular, it will
require the LLVM dylib to be in the linker's load path at runtime), but the
common use case for external LLVMs is distribution provided LLVMs, and in that
case they're usually in the standard search path (e.g., /usr/lib) and copying
them here is going to cause problems as we may end up with the wrong files and
isn't what distributions want.

This behavior may be revisited in the future though.
Co-authored-by: Vadim Petrochenkov <[email protected]>
Co-authored-by: Vadim Petrochenkov <[email protected]>
Co-authored-by: Jonas Schievink <[email protected]>
Co-authored-by: Yuki Okushi <[email protected]>
Co-authored-by: Camelid <[email protected]>
Co-authored-by: Mark Rousskov <[email protected]>
Introduce `TypeVisitor::BreakTy`

Implements MCP rust-lang/compiler-team#383.
r? `@ghost`
cc `@lcnr` `@oli-obk`

~~Blocked on FCP in rust-lang/compiler-team#383.~~
…ith qualifiers inside an `extern "C"` block
Historically the stable tarballs were named after the version number of
the specific tool, instead of the version number of Rust. For example,
both of the following tarballs were part of the same release:

    rustc-1.48.0-x86_64-unknown-linux-gnu.tar.xz
    cargo-0.49.0-x86_64-unknown-linux-gnu.tar.xz

PR #77336 changed the dist code to instead use Rust's version number for
all the tarballs, regardless of the tool they contain:

    rustc-1.48.0-x86_64-unknown-linux-gnu.tar.xz
    cargo-1.48.0-x86_64-unknown-linux-gnu.tar.xz

Because of that there is no need anymore to have a separate `cargo`
field in src/stage0.txt, as the Cargo version will always be the same as
the rustc version. This PR removes the field, simplifying the code and
the maintenance work required while producing releases.
…color, r=jyn514

Rustdoc test compiler output color

Fixes #72915

We just need to be sure it doesn't break rustdoc doctests' compilation checks. Maybe some other unforeseen consequences too?

r? `@ehuss`
cc `@rust-lang/rustdoc`
…imulacrum

[self-profiling] Include the estimated size of each cgu in the profile

This is helpful when looking for CGUs where the size estimate isn't a
good indicator of compilation time.

I verified that moving the profiling timer call doesn't affect the
results.

Results:

<img width="297" alt="Screen Shot 2020-11-03 at 7 25 04 AM" src="https://user-images.githubusercontent.com/831192/97985503-5901d100-1da6-11eb-9f10-f3e399702952.png">

`measureme` doesn't have support for custom arg names yet so `arg0` is the CGU name and `arg1` is the estimated size.
m-ou-se and others added 12 commits November 22, 2020 23:01
BTreeMap: address namespace conflicts

Fix an annoyance popping up whenever synchronizing the test cases with a version capable of miri-track-raw-pointers.

r? `@Mark-Simulacrum`
…k-Simulacrum

Add test for eval order for a+=b

Yes, the order of evaluation *does* change depending on the types of
the operands. Cursed, I know.

I've elected to place this test into `expr/compound-assignment` creating
both the `expr` directory and the `compound-assignment` directory. I
plan in a future PR to also move the `if` directory and the loose `if`
tests into `expr/if` and other similar cleanups of the `test/ui`
directory.

Future work: Test more than just `+=`, but all operators. I don't know
if using a macro to generate these tests cases would be okay or not,
but it'd be boilerplatey without it. I'm also confident you cannot
change the evaluation order of one operator without changing all of
them.

Future work: Additionally, test more than just `i32 += i32` for the
primitive version. I don't actually know the full set of primitive
implementations, but I imagine there's enough to cause a combinatorial
explosion with the previous future work item. Somewhere on the order of
one to two hundred individual functions.
BTreeMap: fix minor testing mistakes in #78903

Mostly a duplicate test case
r? `@Mark-Simulacrum`
BTreeMap: swap the names of NodeRef::new and Root::new_leaf

#78104 preserved the name of Root::new_leaf to minimize changes, but the resulting names are confusing.

r? `@Mark-Simulacrum`
Stabilise `then`

Stabilises the lazy variant of rust-lang/rust#64260 now that the FCP [has ended](rust-lang/rust#64260 (comment)).

I've kept the original feature gate `bool_to_option` for the strict variant (`then_some`), and created a new insta-stable feature gate `lazy_bool_to_option` for `then`.
Rollup of 10 pull requests

Successful merges:

 - #76941 (Add f{32,64}::is_subnormal)
 - #77697 (Split each iterator adapter and source into individual modules)
 - #78305 (Stabilize alloc::Layout const functions)
 - #78608 (Stabilize refcell_take)
 - #78793 (Clean up `StructuralEq` docs)
 - #79267 (BTreeMap: address namespace conflicts)
 - #79293 (Add test for eval order for a+=b)
 - #79295 (BTreeMap: fix minor testing mistakes in #78903)
 - #79297 (BTreeMap: swap the names of NodeRef::new and Root::new_leaf)
 - #79299 (Stabilise `then`)

Failed merges:

r? `@ghost`
`@rustbot` modify labels: rollup
Insta-stabilize the methods `is_ipv4` and `is_ipv6` of `IpAddr`.

Possible because of the recent stabilization of const control flow.

Also adds a test for these methods in a const context.
Add #[cold] attribute to `std::process::abort` and `alloc::alloc::handle_alloc_error`
Stabilize `IpAddr::is_ipv4` and `is_ipv6` as const

Insta-stabilize the methods `is_ipv4` and `is_ipv6` of `std::net::IpAddr` as const, in the same way as [PR#76198](rust-lang/rust#76198).

Possible because of the recent stabilization of const control flow.

Part of #76225 and #76205.
… r=dtolnay

Impl Default for PhantomPinned

`PhantomPinned` is just a marker type, with an obvious default value (the only value). So I can't think of a reason not to do this. Sure, it's used in exotic situations with unsafe code. But the people writing that code can decide for themselves if they can derive `Default`, and in many situations the derived impl will make sense:

```rust
#[derive(Default)]
struct NeedsPin {
   marker: PhantomPinned,
   buf: [u8; 1024],
   ptr_to_data: Option<*const u8>,
}
```
@ptersilie
Copy link
Member

bors r+

bors bot added a commit that referenced this pull request Nov 23, 2020
147: sync upstream r=ptersilie a=vext01



Co-authored-by: Guillaume Gomez <[email protected]>
Co-authored-by: Mahmut Bulut <[email protected]>
Co-authored-by: Pietro Albini <[email protected]>
Co-authored-by: Mark Rousskov <[email protected]>
Co-authored-by: Erin Power <[email protected]>
Co-authored-by: XAMPPRocky <[email protected]>
Co-authored-by: bors <[email protected]>
Co-authored-by: ThePuzzlemaker <[email protected]>
Co-authored-by: Mara Bos <[email protected]>
@bors
Copy link
Contributor

bors bot commented Nov 23, 2020

Build failed:

@vext01
Copy link
Member Author

vext01 commented Nov 24, 2020

---- sys::unix::kernel_copy::tests::bench_file_to_file_copy stdout ----
thread 'sys::unix::kernel_copy::tests::bench_file_to_file_copy' panicked at 'called `Result::unwrap()` on an `Err` value: Os { code: 13, kind: PermissionDenied, message: "Permission denied" }', library/std/src/sys/unix/kernel_copy/tests.rs:71:10
---- sys::unix::kernel_copy::tests::bench_file_to_socket_copy stdout ----
thread 'sys::unix::kernel_copy::tests::bench_file_to_socket_copy' panicked at 'called `Result::unwrap()` on an `Err` value: Os { code: 13, kind: PermissionDenied, message: "Permission denied" }', library/std/src/sys/unix/kernel_copy/tests.rs:100:10

I'm hoping this was a fluke, as those tests just use temp dirs.

@ltratt
Copy link
Member

ltratt commented Nov 24, 2020

OK, let's try again.

bors r+

bors bot added a commit that referenced this pull request Nov 24, 2020
147: sync upstream r=ltratt a=vext01



Co-authored-by: Guillaume Gomez <[email protected]>
Co-authored-by: Mahmut Bulut <[email protected]>
Co-authored-by: Pietro Albini <[email protected]>
Co-authored-by: Mark Rousskov <[email protected]>
Co-authored-by: Erin Power <[email protected]>
Co-authored-by: XAMPPRocky <[email protected]>
Co-authored-by: bors <[email protected]>
Co-authored-by: ThePuzzlemaker <[email protected]>
Co-authored-by: Mara Bos <[email protected]>
@vext01
Copy link
Member Author

vext01 commented Nov 24, 2020

Thanks.

Yeah, this isn't ideal. In upstream's test:

      let path = crate::env::temp_dir();                                                                                                                                                                            
      let source_path = path.join("copy-spec.source");                                                                                                                                                              
      let sink_path = path.join("copy-spec.sink");   

where:

  pub fn temp_dir() -> PathBuf {                                                                                                                                                                                    
      crate::env::var_os("TMPDIR").map(PathBuf::from).unwrap_or_else(|| {                                                                                                                                           
          if cfg!(target_os = "android") {                                                                                                                                                                          
              PathBuf::from("/data/local/tmp")                                                                                                                                                                      
          } else {                                                                                                                                                                                                  
              PathBuf::from("/tmp")                                                                                                                                                                                 
          }                                                                                                                                                                                                         
      })                                                                                                                                                                                                            
  }   

So if both Lukas and I were to concurrently test, we might clash.

@ltratt
Copy link
Member

ltratt commented Nov 24, 2020

Can we file an upstream PR to fix this? That code will cause many people problems at some point, including us!

@vext01
Copy link
Member Author

vext01 commented Nov 24, 2020

Yeah, I'm looking into it now.

@bors
Copy link
Contributor

bors bot commented Nov 24, 2020

Build failed:

@vext01
Copy link
Member Author

vext01 commented Nov 24, 2020

What's happened now is that those files in /tmp have not been cleaned up. They are owned vext01 so the CI worker can't overwrite them.

I'll manually delete them for now.

@vext01
Copy link
Member Author

vext01 commented Nov 24, 2020

Done, please retry.

@ptersilie
Copy link
Member

bors r+

@bors
Copy link
Contributor

bors bot commented Nov 24, 2020

Build succeeded:

@bors bors bot merged commit c49f50f into softdevteam:master Nov 24, 2020
@vext01 vext01 deleted the yk-sync-upstream-20201123 branch November 24, 2020 11:27
@vext01
Copy link
Member Author

vext01 commented Nov 24, 2020

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.