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

Closed
wants to merge 31 commits into from
Closed
Changes from 2 commits
Commits
Show all changes
31 commits
Select commit Hold shift + click to select a range
f020fc0
clarify how Rust atomics correspond to C++ atomics
RalfJung May 29, 2022
8b7299d
Remove `likely!` and `unlikely!` macro from compiler
nbdd0121 May 31, 2022
44364dc
Add release notes for 1.62
Mark-Simulacrum May 27, 2022
7cefa8f
Make RwLockReadGuard covariant
r-raymond May 7, 2022
0b6e6e3
Formatting
r-raymond Jun 19, 2022
391f800
More formatting
r-raymond May 7, 2022
cf1238e
Address comments
r-raymond May 13, 2022
08650fb
*const to NonNull plus documentation
r-raymond May 14, 2022
0157593
Documentation typo
r-raymond May 14, 2022
fa1656e
Add safety comments
r-raymond May 26, 2022
09d937e
Add comment explaining why we use NonNull
r-raymond Jun 16, 2022
cb20e25
Add test to verify noalias is not being added
r-raymond Jun 19, 2022
43c6f9c
Make sure we don't match noalias in later lines
r-raymond Jun 19, 2022
048a801
UnsafeCell -> RwLock
r-raymond Jun 20, 2022
ac38258
Use futex based thread parker on Fuchsia.
m-ou-se May 6, 2022
8eb7ddf
update cpu-usage-over-time-plot script
seanpray Mar 29, 2022
c9340ec
Fix typo
lucasthormann Jun 21, 2022
1ca8b69
remove use of &Alloc in btree tests
RalfJung Jun 21, 2022
4768bfc
hedge our bets
RalfJung Jun 21, 2022
52409c4
Point at return expression for RPIT-related error
compiler-errors Jun 7, 2022
e53b2ba
Add some tests for impossible bounds
compiler-errors Jun 11, 2022
ecda292
Rollup merge of #95446 - notseanray:master, r=Mark-Simulacrum
JohnTitor Jun 22, 2022
4415af5
Rollup merge of #96768 - m-ou-se:futex-fuchsia, r=tmandry
JohnTitor Jun 22, 2022
c7aa270
Rollup merge of #96820 - r-raymond:master, r=cuviper
JohnTitor Jun 22, 2022
ffd6b0f
Rollup merge of #97454 - Mark-Simulacrum:relnotes, r=Mark-Simulacrum
JohnTitor Jun 22, 2022
39520e4
Rollup merge of #97516 - RalfJung:atomics, r=joshtriplett
JohnTitor Jun 22, 2022
3543cd7
Rollup merge of #97818 - compiler-errors:rpit-error-spanned, r=oli-obk
JohnTitor Jun 22, 2022
a07def6
Rollup merge of #97895 - nbdd0121:unlikely, r=estebank
JohnTitor Jun 22, 2022
5b0093a
Rollup merge of #98005 - compiler-errors:impossible-bounds, r=Mark-Si…
JohnTitor Jun 22, 2022
824443d
Rollup merge of #98356 - lucasthormann:patch-1, r=Mark-Simulacrum
JohnTitor Jun 22, 2022
ae8c200
Rollup merge of #98363 - RalfJung:btree-test-ref-alloc, r=thomcc
JohnTitor Jun 22, 2022
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
17 changes: 11 additions & 6 deletions src/test/ui/trait-bounds/issue-93008.rs
Original file line number Diff line number Diff line change
@@ -1,10 +1,15 @@
// compile-flags: -Zmir-opt-level=4
// build-pass
// compile-flags: -Zmir-opt-level=3 --crate-type=lib

pub fn bar<T>(s: &'static mut ())
#![feature(trivial_bounds)]
#![allow(trivial_bounds)]

trait Foo {
fn test(self);
}
fn baz<T>()
where
&'static mut (): Clone, //~ ERROR the trait bound
&'static str: Foo,
{
<&'static mut () as Clone>::clone(&s);
"Foo".test()
}

fn main() {}
12 changes: 0 additions & 12 deletions src/test/ui/trait-bounds/issue-93008.stderr

This file was deleted.

14 changes: 14 additions & 0 deletions src/test/ui/trait-bounds/issue-94680.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
// check-pass

fn main() {
println!("{:?}", {
type T = ();

pub fn cloneit(it: &'_ mut T) -> (&'_ mut T, &'_ mut T)
where
for<'any> &'any mut T: Clone,
{
(it.clone(), it)
}
});
}
34 changes: 34 additions & 0 deletions src/test/ui/trait-bounds/issue-94999.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
// check-pass

trait Identity<Q> {
type T;
}

impl<Q, T> Identity<Q> for T {
type T = T;
}

trait Holds {
type Q;
}

struct S;
struct X(S);

struct XHelper;

impl Holds for X {
type Q = XHelper;
}

impl<Q> Clone for X
where
<S as Identity<Q>>::T: Clone,
X: Holds<Q = Q>,
{
fn clone(&self) -> Self {
Self(self.0.clone())
}
}

fn main() {}
31 changes: 31 additions & 0 deletions src/test/ui/trait-bounds/issue-95640.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
// build-pass
// compile-flags:-Zmir-opt-level=3

struct D;

trait Tr {
type It;
fn foo(self) -> Option<Self::It>;
}

impl<'a> Tr for &'a D {
type It = ();
fn foo(self) -> Option<()> {
None
}
}

fn run<F>(f: F)
where
for<'a> &'a D: Tr,
F: Fn(<&D as Tr>::It),
{
let d = &D;
while let Some(i) = d.foo() {
f(i);
}
}

fn main() {
run(|_| {});
}
43 changes: 43 additions & 0 deletions src/test/ui/trait-bounds/select-param-env-instead-of-blanket.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
// known-bug
// build-fail
// failure-status: 101
// compile-flags:--crate-type=lib -Zmir-opt-level=3
// rustc-env:RUST_BACKTRACE=0

// normalize-stderr-test "thread 'rustc' panicked.*" -> "thread 'rustc' panicked"
// normalize-stderr-test "note:.*RUST_BACKTRACE=1.*\n" -> ""
// normalize-stderr-test "error: internal compiler error.*" -> "error: internal compiler error"
// normalize-stderr-test "encountered.*with incompatible types:" "encountered ... with incompatible types:"
// normalize-stderr-test "note:.*unexpectedly panicked.*\n\n" -> ""
// normalize-stderr-test "note: we would appreciate a bug report.*\n\n" -> ""
// normalize-stderr-test "note: compiler flags.*\n\n" -> ""
// normalize-stderr-test "note: rustc.*running on.*\n\n" -> ""
// normalize-stderr-test "query stack during panic:\n" -> ""
// normalize-stderr-test "we're just showing a limited slice of the query stack\n" -> ""
// normalize-stderr-test "end of query stack\n" -> ""
// normalize-stderr-test "#.*\n" -> ""

// This is a known bug that @compiler-errors tried to fix in #94238,
// but the solution was probably not correct.

pub trait Factory<T> {
type Item;
}

pub struct IntFactory;

impl<T> Factory<T> for IntFactory {
type Item = usize;
}

pub fn foo<T>()
where
IntFactory: Factory<T>,
{
let mut x: <IntFactory as Factory<T>>::Item = bar::<T>();
}

#[inline]
pub fn bar<T>() -> <IntFactory as Factory<T>>::Item {
0usize
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
error: internal compiler error

error: internal compiler error
encountered ... with incompatible types:
left-hand side has type: <IntFactory as Factory<T>>::Item
right-hand side has type: usize
--> $DIR/select-param-env-instead-of-blanket.rs:42:5
|
LL | let mut x: <IntFactory as Factory<T>>::Item = bar::<T>();
| ---------- in this inlined function call
...
LL | 0usize
| ^^^^^^
|
= note: delayed at compiler/rustc_const_eval/src/transform/validate.rs:128:36

thread 'rustc' panicked