Skip to content
Closed
Show file tree
Hide file tree
Changes from 2 commits
Commits
Show all changes
32 commits
Select commit Hold shift + click to select a range
58b1a12
Avoid allocations and copying in Vec::leak
mbrubeck Sep 28, 2021
1fca2ce
Additional docs about Vec::leak behavior
mbrubeck Sep 28, 2021
e71d17b
Edit explanation of test for nested type ascriptions
pierwill Oct 11, 2021
e56d89a
Add missing words in `Infallible` docs
Wilfred Oct 11, 2021
d2564ce
rustdoc: update noto sans kr
Oct 11, 2021
0cf84c8
Add #[must_use] to to_value conversions
jkugelman Oct 11, 2021
0767ed3
add some more testcases
hellow554 Oct 11, 2021
7943c9c
Use Option::map_or instead of open coding it
LingMan Oct 12, 2021
129af04
Mention Rust version in Vec::leak docs.
m-ou-se Oct 12, 2021
81eeb3e
Fix uppercase/lowercase error
jkugelman Oct 12, 2021
df15b28
Remove potentially unsound note on reconstructing a leaked Vec.
m-ou-se Oct 12, 2021
e5cfe84
Fix invalid rules in .gitignore
Canop Oct 12, 2021
a6bb1fb
Add #[inline] to int log10 functions.
m-ou-se Oct 12, 2021
7a646df
Add missing entries for overflow-checks to config.toml.example.
hkratz Oct 11, 2021
cfc7782
Add --enable-overflow-checks-std option to configure script.
hkratz Oct 11, 2021
bcf7cf6
Add --enable-debug-assertions-std option to configure script.
hkratz Oct 12, 2021
905ed5f
Make `rust.overflow-checks-std`option default to `rust.overflow-checks`.
hkratz Oct 12, 2021
f819e6d
suggestion for typoed crate or module
TaKO8Ki Sep 29, 2021
31265c6
Assemble the compiler when running `x.py build`
jyn514 Oct 11, 2021
9bb010e
Rollup merge of #89337 - mbrubeck:vec-leak, r=m-ou-se
the8472 Oct 13, 2021
0a998f8
Rollup merge of #89347 - TaKO8Ki:crate-or-module-typo, r=estebank
the8472 Oct 13, 2021
1ed61f5
Rollup merge of #89759 - jyn514:x-build-assemble, r=Mark-Simulacrum
the8472 Oct 13, 2021
0968607
Rollup merge of #89768 - hellow554:tests, r=Mark-Simulacrum
the8472 Oct 13, 2021
1d63deb
Rollup merge of #89777 - pierwill:fix-88233, r=Mark-Simulacrum
the8472 Oct 13, 2021
0b6839f
Rollup merge of #89781 - Wilfred:patch-2, r=JohnTitor
the8472 Oct 13, 2021
8852409
Rollup merge of #89782 - konan8205:develop, r=jsha
the8472 Oct 13, 2021
5a82eb3
Rollup merge of #89794 - jkugelman:must-use-to_value-conversions, r=j…
the8472 Oct 13, 2021
c4749bf
Rollup merge of #89814 - jkugelman:must-use-string-transforms-typo, r…
the8472 Oct 13, 2021
02cdfcc
Rollup merge of #89816 - Canop:master, r=Mark-Simulacrum
the8472 Oct 13, 2021
626dd87
Rollup merge of #89817 - m-ou-se:int-log-10-inline, r=the8472
the8472 Oct 13, 2021
67f3a5f
Rollup merge of #89818 - LingMan:map_or, r=oli-obk
the8472 Oct 13, 2021
c913af6
Rollup merge of #89828 - rusticstuff:overflow-check-options-take-two,…
the8472 Oct 13, 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
21 changes: 21 additions & 0 deletions src/test/ui/consts/issue-88071.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
// check-pass
//
// regression test for #88071

#![feature(const_btree_new)]
#![feature(const_fn_trait_bound)]

use std::collections::BTreeMap;

pub struct CustomMap<K, V>(BTreeMap<K, V>);

impl<K, V> CustomMap<K, V>
where
K: Ord,
{
pub const fn new() -> Self {
CustomMap(BTreeMap::new())
}
}

fn main() {}
22 changes: 22 additions & 0 deletions src/test/ui/generic-associated-types/issue-87750.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
#![feature(generic_associated_types)]

trait PointerFamily {
type Pointer<T>;
}

struct Rc<T>(Box<T>);
struct RcFamily;

impl PointerFamily for RcFamily {
type Pointer<T> = Rc<T>;
}

#[allow(dead_code)]
enum Node<T, P: PointerFamily> where P::Pointer<Node<T, P>>: Sized {
Cons(P::Pointer<Node<T, P>>),
}

fn main() {
let _list: <RcFamily as PointerFamily>::Pointer<Node<i32, RcFamily>>;
//~^ ERROR overflow evaluating the requirement `Node<i32, RcFamily>: Sized`
}
9 changes: 9 additions & 0 deletions src/test/ui/generic-associated-types/issue-87750.stderr
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
error[E0275]: overflow evaluating the requirement `Node<i32, RcFamily>: Sized`
--> $DIR/issue-87750.rs:20:16
|
LL | let _list: <RcFamily as PointerFamily>::Pointer<Node<i32, RcFamily>>;
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

error: aborting due to previous error

For more information about this error, try `rustc --explain E0275`.
57 changes: 57 additions & 0 deletions src/test/ui/traits/issue-52893.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@
// check-fail
//
// regression test for issue 52893
trait At<Name> {
type AtRes;
fn at(self) -> Self::AtRes;
}

trait Push<T> {
type PushRes;
fn push(self, other: T) -> Self::PushRes;
}

trait AddClass<Name, F> {
type AddRes;
fn init(self, func: F);
}

trait ToRef {
type RefRes;
fn to_ref(&self) -> Self::RefRes;
}

struct Class<P>(P);

impl<P> Class<P> {
fn with<Name, F>(self) -> <Self as AddClass<Name, F>>::AddRes
where
Self: AddClass<Name, F>,
{
todo!()
}

fn from<F>(self) -> <Self as AddClass<P, F>>::AddRes
where
Self: AddClass<P, F>,
{
todo!()
}
}

impl<F, Name, P> AddClass<Name, F> for Class<P>
where
Self: At<Name>,
<Self as At<Name>>::AtRes: Push<F>,
<<Self as At<Name>>::AtRes as Push<F>>::PushRes: ToRef<RefRes = Self> + Push<F>,
{
type AddRes = ();

fn init(self, func: F) {
let builder = self.at().push(func);
let output = builder.to_ref();
builder.push(output); //~ ERROR mismatched types [E0308]
}
}

fn main() {}
15 changes: 15 additions & 0 deletions src/test/ui/traits/issue-52893.stderr
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
error[E0308]: mismatched types
--> $DIR/issue-52893.rs:53:22
|
LL | impl<F, Name, P> AddClass<Name, F> for Class<P>
| - this type parameter
...
LL | builder.push(output);
| ^^^^^^ expected type parameter `F`, found struct `Class`
|
= note: expected type parameter `F`
found struct `Class<P>`

error: aborting due to previous error

For more information about this error, try `rustc --explain E0308`.
47 changes: 47 additions & 0 deletions src/test/ui/traits/issue-68295.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
// check-fail
//
// regression test for #68295

struct Matrix<R, C, S>(R, C, S);

impl<R, C, S> Matrix<R, C, S> {
fn into_owned(self) -> Matrix<R, C, Owned<R, C, ()>>
where
(): Allocator<R, C>,
{
unimplemented!()
}
}

impl<D, S> Matrix<D, D, S> {
fn hermitian_part(&self) -> Matrix<D, D, Owned<D, D, ()>>
where
(): Allocator<D, D>,
{
unimplemented!()
}
}

trait Allocator<R, C> {
type Buffer;
}

trait Trait<R, C, A> {
type Power;
}

impl<R, C, A: Allocator<R, C>> Trait<R, C, A> for () {
type Power = A::Buffer;
}

type Owned<R, C, G> = <G as Trait<R, C, ()>>::Power;

fn crash<R, C>(input: Matrix<R, C, ()>) -> Matrix<R, C, u32>
where
(): Allocator<R, C>,
{
input.into_owned()
//~^ ERROR mismatched types [E0308]
}

fn main() {}
17 changes: 17 additions & 0 deletions src/test/ui/traits/issue-68295.stderr
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
error[E0308]: mismatched types
--> $DIR/issue-68295.rs:43:5
|
LL | fn crash<R, C>(input: Matrix<R, C, ()>) -> Matrix<R, C, u32>
| ----------------- expected `Matrix<R, C, u32>` because of return type
...
LL | input.into_owned()
| ^^^^^^^^^^^^^^^^^^ expected `u32`, found associated type
|
= note: expected struct `Matrix<_, _, u32>`
found struct `Matrix<_, _, <() as Allocator<R, C>>::Buffer>`
= help: consider constraining the associated type `<() as Allocator<R, C>>::Buffer` to `u32`
= note: for more information, visit https://doc.rust-lang.org/book/ch19-03-advanced-traits.html

error: aborting due to previous error

For more information about this error, try `rustc --explain E0308`.