Skip to content
Closed
Show file tree
Hide file tree
Changes from 2 commits
Commits
Show all changes
39 commits
Select commit Hold shift + click to select a range
8bc120a
Add an ability to convert between `Span` and `visit::Location`
artemagvanian Aug 16, 2024
d7b2fd4
Clean up cfg-gating of ProcessPrng extern
goffrie Aug 21, 2024
40481fc
format
goffrie Aug 21, 2024
515f5ac
Introduce methods for obtaining `Location` for statements and termina…
artemagvanian Aug 23, 2024
70ba8c1
format code in tests/ui/threads-sendsync
tshepang Aug 24, 2024
834d615
Update books
rustbot Aug 26, 2024
a673e4f
Update src/tools/rustbook/Cargo.lock
ehuss Aug 26, 2024
fcb04b8
Improve `isqrt` tests and add benchmarks
ChaiTRex Aug 26, 2024
8e54e87
Speed up `checked_isqrt` and `isqrt` methods
ChaiTRex Aug 26, 2024
4f847bd
rustc_target: Add various aarch64 features
mrkajetanp Jun 14, 2024
c351806
rustc_target: Add SME aarch64 features
mrkajetanp Jun 17, 2024
4fc4019
rustc_target: Remove fpmr target feature
mrkajetanp Jul 29, 2024
3a0fbb5
rustc_codegen_llvm: Filter out unavailable LLVM features
mrkajetanp Aug 9, 2024
0f871b5
tests: Update with new aarch64 target features
mrkajetanp Aug 9, 2024
169b2f0
library: Stabilize new_uninit for Box, Rc, and Arc
workingjubilee Aug 22, 2024
2535a0f
compiler: Remove feature(new_uninit)
workingjubilee Aug 22, 2024
605d9cf
miri: Remove feature(new_uninit)
workingjubilee Aug 22, 2024
c11d46f
Add fmt::Debug to sync::Weak<T, A>
Aug 28, 2024
0589dc7
copysign with sign being a NaN is non-portable
RalfJung Aug 28, 2024
4e6cd0f
Fix path to run clippy on rustdoc
GuillaumeGomez Aug 28, 2024
7c4cc9f
Update reference
ehuss Aug 28, 2024
3914835
derive(SmartPointer): assume pointee from the single generic and bett…
dingxiangfei2009 Aug 23, 2024
b013a3d
Emit specific message for `time<0.3.35` inference failure
estebank Aug 21, 2024
d8129a1
Correct trusty targets to be tier 3
randomPoison Aug 28, 2024
555414e
Update `compiler_builtins` to `0.1.123`
Amjad50 Aug 29, 2024
3926960
Rollup merge of #128166 - ChaiTRex:isqrt, r=tgross35
workingjubilee Aug 29, 2024
97d1417
Rollup merge of #128192 - mrkajetanp:feature-detect, r=Amanieu
workingjubilee Aug 29, 2024
0c5a6fe
Rollup merge of #129170 - artemagvanian:span-to-location, r=celinval
workingjubilee Aug 29, 2024
c7fd8d8
Rollup merge of #129343 - estebank:time-version, r=jieyouxu
workingjubilee Aug 29, 2024
36e233a
Rollup merge of #129378 - goffrie:patch-3, r=ChrisDenton
workingjubilee Aug 29, 2024
b717607
Rollup merge of #129401 - workingjubilee:partial-initialization-of-st…
workingjubilee Aug 29, 2024
c05e451
Rollup merge of #129467 - dingxiangfei2009:smart-pointer-relax-pointe…
workingjubilee Aug 29, 2024
f6a3c2f
Rollup merge of #129494 - tshepang:fmt-threads-sendsync, r=Nadrieril
workingjubilee Aug 29, 2024
ef44b66
Rollup merge of #129617 - rustbot:docs-update, r=ehuss
workingjubilee Aug 29, 2024
45d0467
Rollup merge of #129673 - matthewpipie:arc-weak-debug-trait, r=dtolnay
workingjubilee Aug 29, 2024
e35b8f2
Rollup merge of #129683 - RalfJung:copysign, r=thomcc
workingjubilee Aug 29, 2024
6c7882a
Rollup merge of #129695 - GuillaumeGomez:fix-clippy-rustdoc-path, r=o…
workingjubilee Aug 29, 2024
5862476
Rollup merge of #129712 - randomPoison:trusty-tier-3-fix, r=saethlin
workingjubilee Aug 29, 2024
df0eeb9
Rollup merge of #129715 - Amjad50:update-compiler-builtins, r=tgross35
workingjubilee Aug 29, 2024
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
4 changes: 2 additions & 2 deletions tests/ui/threads-sendsync/child-outlives-parent.rs
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@

use std::thread;

fn child2(_s: String) { }
fn child2(_s: String) {}

pub fn main() {
let _x = thread::spawn(move|| child2("hi".to_string()));
let _x = thread::spawn(move || child2("hi".to_string()));
}
9 changes: 5 additions & 4 deletions tests/ui/threads-sendsync/clone-with-exterior.rs
Original file line number Diff line number Diff line change
Expand Up @@ -7,14 +7,15 @@ use std::thread;

struct Pair {
a: isize,
b: isize
b: isize,
}

pub fn main() {
let z: Box<_> = Box::new(Pair { a : 10, b : 12});
let z: Box<_> = Box::new(Pair { a: 10, b: 12 });

thread::spawn(move|| {
thread::spawn(move || {
assert_eq!(z.a, 10);
assert_eq!(z.b, 12);
}).join();
})
.join();
}
4 changes: 2 additions & 2 deletions tests/ui/threads-sendsync/comm.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,12 @@
#![allow(unused_must_use)]
//@ needs-threads

use std::thread;
use std::sync::mpsc::{channel, Sender};
use std::thread;

pub fn main() {
let (tx, rx) = channel();
let t = thread::spawn(move || { child(&tx) });
let t = thread::spawn(move || child(&tx));
let y = rx.recv().unwrap();
println!("received");
println!("{}", y);
Expand Down
14 changes: 8 additions & 6 deletions tests/ui/threads-sendsync/issue-24313.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,15 @@
//@ needs-threads
//@ ignore-sgx no processes

use std::thread;
use std::env;
use std::process::Command;
use std::{env, thread};

struct Handle(i32);

impl Drop for Handle {
fn drop(&mut self) { panic!(); }
fn drop(&mut self) {
panic!();
}
}

thread_local!(static HANDLE: Handle = Handle(0));
Expand All @@ -19,14 +20,15 @@ fn main() {
if args.len() == 1 {
let out = Command::new(&args[0]).arg("test").output().unwrap();
let stderr = std::str::from_utf8(&out.stderr).unwrap();
assert!(stderr.contains("explicit panic"),
"bad failure message:\n{}\n", stderr);
assert!(stderr.contains("explicit panic"), "bad failure message:\n{}\n", stderr);
} else {
// TLS dtors are not always run on process exit
thread::spawn(|| {
HANDLE.with(|h| {
println!("{}", h.0);
});
}).join().unwrap();
})
.join()
.unwrap();
}
}
4 changes: 3 additions & 1 deletion tests/ui/threads-sendsync/issue-29488.rs
Original file line number Diff line number Diff line change
Expand Up @@ -19,5 +19,7 @@ fn main() {
thread::spawn(|| {
FOO.with(|_| {});
println!("test1");
}).join().unwrap();
})
.join()
.unwrap();
}
7 changes: 5 additions & 2 deletions tests/ui/threads-sendsync/issue-4446.rs
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,10 @@ pub fn main() {

tx.send("hello, world").unwrap();

thread::spawn(move|| {
thread::spawn(move || {
println!("{}", rx.recv().unwrap());
}).join().ok().unwrap();
})
.join()
.ok()
.unwrap();
}
2 changes: 1 addition & 1 deletion tests/ui/threads-sendsync/issue-4448.rs
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ use std::thread;
pub fn main() {
let (tx, rx) = channel::<&'static str>();

let t = thread::spawn(move|| {
let t = thread::spawn(move || {
assert_eq!(rx.recv().unwrap(), "hello, world");
});

Expand Down
10 changes: 5 additions & 5 deletions tests/ui/threads-sendsync/issue-8827.rs
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
//@ run-pass
//@ needs-threads

use std::thread;
use std::sync::mpsc::{channel, Receiver};
use std::thread;

fn periodical(n: isize) -> Receiver<bool> {
let (chan, port) = channel();
thread::spawn(move|| {
thread::spawn(move || {
loop {
for _ in 1..n {
match chan.send(false) {
Expand All @@ -16,7 +16,7 @@ fn periodical(n: isize) -> Receiver<bool> {
}
match chan.send(true) {
Ok(()) => {}
Err(..) => break
Err(..) => break,
}
}
});
Expand All @@ -25,7 +25,7 @@ fn periodical(n: isize) -> Receiver<bool> {

fn integers() -> Receiver<isize> {
let (chan, port) = channel();
thread::spawn(move|| {
thread::spawn(move || {
let mut i = 1;
loop {
match chan.send(i) {
Expand All @@ -47,7 +47,7 @@ fn main() {
(_, true, true) => println!("FizzBuzz"),
(_, true, false) => println!("Fizz"),
(_, false, true) => println!("Buzz"),
(i, false, false) => println!("{}", i)
(i, false, false) => println!("{}", i),
}
}
}
6 changes: 3 additions & 3 deletions tests/ui/threads-sendsync/issue-9396.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,20 +3,20 @@
#![allow(deprecated)]
//@ needs-threads

use std::sync::mpsc::{TryRecvError, channel};
use std::sync::mpsc::{channel, TryRecvError};
use std::thread;

pub fn main() {
let (tx, rx) = channel();
let t = thread::spawn(move||{
let t = thread::spawn(move || {
thread::sleep_ms(10);
tx.send(()).unwrap();
});
loop {
match rx.try_recv() {
Ok(()) => break,
Err(TryRecvError::Empty) => {}
Err(TryRecvError::Disconnected) => unreachable!()
Err(TryRecvError::Disconnected) => unreachable!(),
}
}
t.join();
Expand Down
17 changes: 4 additions & 13 deletions tests/ui/threads-sendsync/mpsc_stress.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,18 +2,12 @@
//@ compile-flags:--test
//@ needs-threads

use std::sync::mpsc::channel;
use std::sync::mpsc::TryRecvError;
use std::sync::mpsc::RecvError;
use std::sync::mpsc::RecvTimeoutError;
use std::sync::atomic::{AtomicUsize, Ordering};
use std::sync::mpsc::{channel, RecvError, RecvTimeoutError, TryRecvError};
use std::sync::Arc;
use std::sync::atomic::AtomicUsize;
use std::sync::atomic::Ordering;

use std::thread;
use std::time::Duration;


/// Simple thread synchronization utility
struct Barrier {
// Not using mutex/condvar for precision
Expand Down Expand Up @@ -42,7 +36,6 @@ impl Barrier {
}
}


fn shared_close_sender_does_not_lose_messages_iter() {
let (tb, rb) = Barrier::new2();

Expand Down Expand Up @@ -71,7 +64,6 @@ fn shared_close_sender_does_not_lose_messages() {
});
}


// https://github.com/rust-lang/rust/issues/39364
fn concurrent_recv_timeout_and_upgrade_iter() {
// 1 us
Expand All @@ -85,8 +77,8 @@ fn concurrent_recv_timeout_and_upgrade_iter() {
match rx.recv_timeout(sleep) {
Ok(_) => {
break;
},
Err(_) => {},
}
Err(_) => {}
}
}
});
Expand All @@ -105,7 +97,6 @@ fn concurrent_recv_timeout_and_upgrade() {
});
}


fn concurrent_writes_iter() {
const THREADS: usize = 4;
const PER_THR: usize = 100;
Expand Down
17 changes: 7 additions & 10 deletions tests/ui/threads-sendsync/send-is-not-static-par-for.rs
Original file line number Diff line number Diff line change
@@ -1,12 +1,13 @@
//@ run-pass
#![allow(unused_imports)]
use std::thread;
use std::sync::Mutex;
use std::thread;

fn par_for<I, F>(iter: I, f: F)
where I: Iterator,
I::Item: Send,
F: Fn(I::Item) + Sync
where
I: Iterator,
I::Item: Send,
F: Fn(I::Item) + Sync,
{
for item in iter {
f(item)
Expand All @@ -15,9 +16,7 @@ fn par_for<I, F>(iter: I, f: F)

fn sum(x: &[i32]) {
let sum_lengths = Mutex::new(0);
par_for(x.windows(4), |x| {
*sum_lengths.lock().unwrap() += x.len()
});
par_for(x.windows(4), |x| *sum_lengths.lock().unwrap() += x.len());

assert_eq!(*sum_lengths.lock().unwrap(), (x.len() - 3) * 4);
}
Expand All @@ -26,9 +25,7 @@ fn main() {
let mut elements = [0; 20];

// iterators over references into this stack frame
par_for(elements.iter_mut().enumerate(), |(i, x)| {
*x = i as i32
});
par_for(elements.iter_mut().enumerate(), |(i, x)| *x = i as i32);

sum(&elements)
}
10 changes: 4 additions & 6 deletions tests/ui/threads-sendsync/send-resource.rs
Original file line number Diff line number Diff line change
Expand Up @@ -6,27 +6,25 @@
//@ pretty-expanded FIXME #23616
//@ needs-threads

use std::thread;
use std::sync::mpsc::channel;
use std::thread;

struct test {
f: isize,
f: isize,
}

impl Drop for test {
fn drop(&mut self) {}
}

fn test(f: isize) -> test {
test {
f: f
}
test { f: f }
}

pub fn main() {
let (tx, rx) = channel();

let t = thread::spawn(move|| {
let t = thread::spawn(move || {
let (tx2, rx2) = channel();
tx.send(tx2).unwrap();

Expand Down
6 changes: 3 additions & 3 deletions tests/ui/threads-sendsync/send-type-inference.rs
Original file line number Diff line number Diff line change
Expand Up @@ -9,11 +9,11 @@ use std::sync::mpsc::{channel, Sender};
// tests that ctrl's type gets inferred properly
struct Command<K, V> {
key: K,
val: V
val: V,
}

fn cache_server<K:Send+'static,V:Send+'static>(mut tx: Sender<Sender<Command<K, V>>>) {
fn cache_server<K: Send + 'static, V: Send + 'static>(mut tx: Sender<Sender<Command<K, V>>>) {
let (tx1, _rx) = channel();
tx.send(tx1);
}
pub fn main() { }
pub fn main() {}
6 changes: 2 additions & 4 deletions tests/ui/threads-sendsync/send_str_hashmap.rs
Original file line number Diff line number Diff line change
@@ -1,9 +1,7 @@
//@ run-pass
use std::collections::HashMap;
use std::borrow::Cow;

use std::borrow::Cow::Borrowed as B;
use std::borrow::Cow::Owned as O;
use std::borrow::Cow::{Borrowed as B, Owned as O};
use std::collections::HashMap;

type SendStr = Cow<'static, str>;

Expand Down
13 changes: 6 additions & 7 deletions tests/ui/threads-sendsync/send_str_treemap.rs
Original file line number Diff line number Diff line change
@@ -1,8 +1,7 @@
//@ run-pass
use std::collections::BTreeMap;
use std::borrow::Cow;

use std::borrow::Cow::{Owned as O, Borrowed as B};
use std::borrow::Cow::{Borrowed as B, Owned as O};
use std::collections::BTreeMap;

type SendStr = Cow<'static, str>;

Expand Down Expand Up @@ -51,8 +50,8 @@ fn main() {
assert_eq!(map.get(&O("def".to_string())), Some(&d));

assert!(map.remove(&B("foo")).is_some());
assert_eq!(map.into_iter().map(|(k, v)| format!("{}{}", k, v))
.collect::<Vec<String>>()
.concat(),
"abc50bcd51cde52def53".to_string());
assert_eq!(
map.into_iter().map(|(k, v)| format!("{}{}", k, v)).collect::<Vec<String>>().concat(),
"abc50bcd51cde52def53".to_string()
);
}
11 changes: 4 additions & 7 deletions tests/ui/threads-sendsync/sendable-class.rs
Original file line number Diff line number Diff line change
Expand Up @@ -11,15 +11,12 @@
use std::sync::mpsc::channel;

struct foo {
i: isize,
j: char,
i: isize,
j: char,
}

fn foo(i:isize, j: char) -> foo {
foo {
i: i,
j: j
}
fn foo(i: isize, j: char) -> foo {
foo { i: i, j: j }
}

pub fn main() {
Expand Down
6 changes: 4 additions & 2 deletions tests/ui/threads-sendsync/sendfn-is-a-block.rs
Original file line number Diff line number Diff line change
@@ -1,7 +1,9 @@
//@ run-pass


fn test<F>(f: F) -> usize where F: FnOnce(usize) -> usize {
fn test<F>(f: F) -> usize
where
F: FnOnce(usize) -> usize,
{
return f(22);
}

Expand Down
Loading