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 #82263

Merged
merged 30 commits into from
Feb 18, 2021
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
30 commits
Select commit Hold shift + click to select a range
dfa581f
Fix pretty printing of generic associated type constraints
matthewjasper Feb 11, 2021
9bbd3e0
Remove ProjectionTy::from_ref_and_name
matthewjasper Feb 11, 2021
0bf1d73
Don't go through TraitRef to relate projections
matthewjasper Feb 12, 2021
9526c0c
Avoid `trait_ref` when lowering ExistentialProjections
matthewjasper Feb 12, 2021
79f6f11
Remove some unnecessary `trait_ref` calls
matthewjasper Feb 12, 2021
dfee89f
Make ProjectionTy::trait_ref truncate substs again
matthewjasper Feb 12, 2021
d785c8c
Remove unnecessary function parameters project.rs
matthewjasper Feb 12, 2021
eeb82e4
Add more tests for generic associated type bounds
matthewjasper Feb 12, 2021
7e368e5
the environment round here is awfully empty
BoxyUwU Feb 15, 2021
0f04875
replace if-let and while-let with `if let` and `while let`
TaKO8Ki Feb 17, 2021
43aed74
[libtest] Run the test synchronously when hitting thread limit
Jan 29, 2021
2a66685
Make sure pdbs are copied along with exe and dlls when bootstrapping
rylev Feb 17, 2021
32c97da
In some limited cases, suggest `where` bounds for non-type params
estebank Feb 16, 2021
ec50a20
avoid converting types into themselves (clippy::useless_conversion)
matthiaskrgr Feb 17, 2021
5ae392f
Add long explanation for E0549
jesusprubio Feb 18, 2021
5112cf0
Update compiler/rustc_error_codes/src/error_codes/E0549.md
jesusprubio Feb 18, 2021
0e01c41
Update compiler/rustc_error_codes/src/error_codes/E0549.md
jesusprubio Feb 18, 2021
3c4fe1e
Update compiler/rustc_error_codes/src/error_codes/E0549.md
jesusprubio Feb 18, 2021
6165d1c
Print -Ztime-passes (and misc stats/logs) on stderr, not stdout.
eddyb Feb 18, 2021
8a5c568
nhwn: optimize counting digits in line numbers
nhwn Feb 18, 2021
55ab2e3
Rollup merge of #81546 - hyd-dev:libtest-run-out-of-threads, r=Mark-S…
Dylan-DPC Feb 18, 2021
66211f6
Rollup merge of #82066 - matthewjasper:trait-ref-fix, r=jackh726
Dylan-DPC Feb 18, 2021
928819a
Rollup merge of #82112 - BoxyUwU:tumbleweed, r=varkor
Dylan-DPC Feb 18, 2021
f01b339
Rollup merge of #82194 - estebank:arbitrary-bounds-suggestion, r=petr…
Dylan-DPC Feb 18, 2021
b3d3251
Rollup merge of #82215 - TaKO8Ki:replace-if-let-while-let, r=varkor
Dylan-DPC Feb 18, 2021
01104b5
Rollup merge of #82218 - rylev:copy-pdbs, r=Mark-Simulacrum
Dylan-DPC Feb 18, 2021
04df75a
Rollup merge of #82236 - matthiaskrgr:useless_conv, r=jyn514
Dylan-DPC Feb 18, 2021
5ca94cd
Rollup merge of #82246 - jesusprubio:add-long-explanation-e0549, r=Gu…
Dylan-DPC Feb 18, 2021
555db2d
Rollup merge of #82248 - nhwn:optimize-counting-digits, r=varkor
Dylan-DPC Feb 18, 2021
efdcb43
Rollup merge of #82256 - eddyb:time-passes-stderr, r=varkor
Dylan-DPC Feb 18, 2021
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
[libtest] Run the test synchronously when hitting thread limit
  • Loading branch information
hyd-dev committed Feb 17, 2021
commit 43aed7441ee289c6228ecead91ee66245122b880
13 changes: 12 additions & 1 deletion library/test/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -506,7 +506,18 @@ pub fn run_test(
let supports_threads = !cfg!(target_os = "emscripten") && !cfg!(target_arch = "wasm32");
if concurrency == Concurrent::Yes && supports_threads {
let cfg = thread::Builder::new().name(name.as_slice().to_owned());
Some(cfg.spawn(runtest).unwrap())
let mut runtest = Arc::new(Mutex::new(Some(runtest)));
let runtest2 = runtest.clone();
match cfg.spawn(move || runtest2.lock().unwrap().take().unwrap()()) {
Ok(handle) => Some(handle),
Err(e) if e.kind() == io::ErrorKind::WouldBlock => {
// `ErrorKind::WouldBlock` means hitting the thread limit on some
// platforms, so run the test synchronously here instead.
Arc::get_mut(&mut runtest).unwrap().get_mut().unwrap().take().unwrap()();
None
}
Err(e) => panic!("failed to spawn thread to run test: {}", e),
}
} else {
runtest();
None
Expand Down
7 changes: 7 additions & 0 deletions src/test/run-make/libtest-thread-limit/Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
-include ../../run-make-fulldeps/tools.mk

# only-linux

all:
$(RUSTC) test.rs --test --target $(TARGET)
$(shell ulimit -p 0 && $(call RUN,test))
16 changes: 16 additions & 0 deletions src/test/run-make/libtest-thread-limit/test.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
#![feature(once_cell)]

use std::{io::ErrorKind, lazy::SyncOnceCell, thread::{self, Builder, ThreadId}};

static THREAD_ID: SyncOnceCell<ThreadId> = SyncOnceCell::new();

#[test]
fn spawn_thread_would_block() {
assert_eq!(Builder::new().spawn(|| unreachable!()).unwrap_err().kind(), ErrorKind::WouldBlock);
THREAD_ID.set(thread::current().id()).unwrap();
}

#[test]
fn run_in_same_thread() {
assert_eq!(*THREAD_ID.get().unwrap(), thread::current().id());
}