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

Merged
merged 37 commits into from
Apr 24, 2023
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
37 commits
Select commit Hold shift + click to select a range
41e3cc4
Add some tests around (lack of) object safety of associated types and…
oli-obk Apr 20, 2023
704a9da
Ignore src/bootstrap formatting commit in .git-blame-ignore-revs
jyn514 Apr 20, 2023
fa35156
pointer-auth-link-with-c: Fix cross compilation.
pcc Apr 22, 2023
adb5ded
add known-bug test for unsound issue 25860
whtahy Apr 18, 2023
2fb2098
add known-bug test for unsound issue 49206
whtahy Apr 18, 2023
232d685
add known-bug test for unsound issue 57893
whtahy Apr 19, 2023
fbfb620
add known-bug test for unsound issue 84366
whtahy Apr 19, 2023
cac62ab
add known-bug test for unsound issue 84533
whtahy Apr 19, 2023
be68c69
add known-bug test for unsound issue 84591
whtahy Apr 19, 2023
3c5de9a
add known-bug test for unsound issue 85099
whtahy Apr 20, 2023
3338ee3
drop unused deps, gate libc under unix for one crate
klensy Apr 22, 2023
0e68cbd
Remove useless special case.
cjgillot Apr 15, 2023
629cdb4
Move eval_discriminant.
cjgillot Apr 15, 2023
dd452ae
Simplify logic.
cjgillot Apr 15, 2023
dd78b99
Reduce rightward drift.
cjgillot Apr 15, 2023
3141262
add known-bug test for unsound issue 98117
whtahy Apr 22, 2023
cff6c0e
add known-bug test for unsound issue 100041
whtahy Apr 22, 2023
6f6550f
add known-bug test for unsound issue 100051
whtahy Apr 22, 2023
ebe61ce
add known-bug test for unsound issue 104005
whtahy Apr 22, 2023
f5e535c
bootstrap: update paths cargo-credential crate
weihanglo Apr 23, 2023
31531ce
Add size asserts for MIR `SourceScopeData` & `VarDebugInfo`
scottmcm Apr 24, 2023
5c70287
Add regression test for #60522
GuillaumeGomez Apr 24, 2023
e496fbe
Split `{Idx, IndexVec, IndexSlice}` into their own modules
WaffleLapkin Apr 19, 2023
99ebfe2
move index code around
WaffleLapkin Apr 19, 2023
7d23b52
`const`-ify some `{IndexVec, IndexSlice}` methods
WaffleLapkin Apr 19, 2023
5d809b1
Decorative changes to `IndexVec`
WaffleLapkin Apr 19, 2023
c0daff0
Fix `rustc_index` imports outside the compiler
WaffleLapkin Apr 19, 2023
42467d5
Rollup merge of #110480 - whtahy:105107/known-bug-tests-for-unsound-i…
JohnTitor Apr 24, 2023
cefb479
Rollup merge of #110539 - WaffleLapkin:split_index_vec&slice, r=cjgillot
JohnTitor Apr 24, 2023
1a906f2
Rollup merge of #110590 - oli-obk:object_safe_assoc_types, r=jackh726
JohnTitor Apr 24, 2023
e0bb7bb
Rollup merge of #110602 - jyn514:ignore-fmt, r=Mark-Simulacrum
JohnTitor Apr 24, 2023
2a2df56
Rollup merge of #110667 - pcc:fix-pointer-auth-link-with-c, r=Mark-Si…
JohnTitor Apr 24, 2023
a373623
Rollup merge of #110681 - klensy:cut-dep, r=lcnr
JohnTitor Apr 24, 2023
4d3ab3d
Rollup merge of #110685 - cjgillot:clean-dcp, r=oli-obk
JohnTitor Apr 24, 2023
b708aad
Rollup merge of #110744 - weihanglo:cargo-credential-install, r=ehuss
JohnTitor Apr 24, 2023
16fdef7
Rollup merge of #110750 - scottmcm:vardebug-size, r=cjgillot
JohnTitor Apr 24, 2023
513c0cc
Rollup merge of #110760 - GuillaumeGomez:regression-60522, r=notriddle
JohnTitor Apr 24, 2023
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
Next Next commit
Add some tests around (lack of) object safety of associated types and…
… consts
  • Loading branch information
oli-obk committed Apr 20, 2023
commit 41e3cc4c963450111eea9132c97258d9644e3f1e
13 changes: 13 additions & 0 deletions tests/ui/object-safety/assoc_const_bounds.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
trait Foo<T> {
const BAR: bool
where //~ ERROR: expected one of `!`, `(`, `+`, `::`, `;`, `<`, or `=`, found keyword `where`
Self: Sized;
}

trait Cake {}
impl Cake for () {}

fn foo(_: &dyn Foo<()>) {}
fn bar(_: &dyn Foo<i32>) {}

fn main() {}
15 changes: 15 additions & 0 deletions tests/ui/object-safety/assoc_const_bounds.stderr
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
error: expected one of `!`, `(`, `+`, `::`, `;`, `<`, or `=`, found keyword `where`
--> $DIR/assoc_const_bounds.rs:3:9
|
LL | trait Foo<T> {
| - while parsing this item list starting here
LL | const BAR: bool
| - expected one of 7 possible tokens
LL | where
| ^^^^^ unexpected token
LL | Self: Sized;
LL | }
| - the item list ends here

error: aborting due to previous error

9 changes: 9 additions & 0 deletions tests/ui/object-safety/assoc_const_bounds_sized.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
trait Foo {
const BAR: bool
where //~ ERROR: expected one of `!`, `(`, `+`, `::`, `;`, `<`, or `=`, found keyword `where`
Self: Sized;
}

fn foo(_: &dyn Foo) {}

fn main() {}
15 changes: 15 additions & 0 deletions tests/ui/object-safety/assoc_const_bounds_sized.stderr
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
error: expected one of `!`, `(`, `+`, `::`, `;`, `<`, or `=`, found keyword `where`
--> $DIR/assoc_const_bounds_sized.rs:3:9
|
LL | trait Foo {
| - while parsing this item list starting here
LL | const BAR: bool
| - expected one of 7 possible tokens
LL | where
| ^^^^^ unexpected token
LL | Self: Sized;
LL | }
| - the item list ends here

error: aborting due to previous error

13 changes: 13 additions & 0 deletions tests/ui/object-safety/assoc_type_bounds.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
trait Foo<T> {
type Bar
where
T: Cake;
}

trait Cake {}
impl Cake for () {}

fn foo(_: &dyn Foo<()>) {} //~ ERROR: the value of the associated type `Bar` (from trait `Foo`) must be specified
fn bar(_: &dyn Foo<i32>) {} //~ ERROR: the value of the associated type `Bar` (from trait `Foo`) must be specified

fn main() {}
21 changes: 21 additions & 0 deletions tests/ui/object-safety/assoc_type_bounds.stderr
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
error[E0191]: the value of the associated type `Bar` (from trait `Foo`) must be specified
--> $DIR/assoc_type_bounds.rs:10:16
|
LL | type Bar
| -------- `Bar` defined here
...
LL | fn foo(_: &dyn Foo<()>) {}
| ^^^^^^^ help: specify the associated type: `Foo<(), Bar = Type>`

error[E0191]: the value of the associated type `Bar` (from trait `Foo`) must be specified
--> $DIR/assoc_type_bounds.rs:11:16
|
LL | type Bar
| -------- `Bar` defined here
...
LL | fn bar(_: &dyn Foo<i32>) {}
| ^^^^^^^^ help: specify the associated type: `Foo<i32, Bar = Type>`

error: aborting due to 2 previous errors

For more information about this error, try `rustc --explain E0191`.
13 changes: 13 additions & 0 deletions tests/ui/object-safety/assoc_type_bounds2.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
trait Foo<T> {
type Bar
where
Self: Foo<()>;
}

trait Cake {}
impl Cake for () {}

fn foo(_: &dyn Foo<()>) {} //~ ERROR: the value of the associated type `Bar` (from trait `Foo`) must be specified
fn bar(_: &dyn Foo<i32>) {} //~ ERROR: the value of the associated type `Bar` (from trait `Foo`) must be specified

fn main() {}
21 changes: 21 additions & 0 deletions tests/ui/object-safety/assoc_type_bounds2.stderr
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
error[E0191]: the value of the associated type `Bar` (from trait `Foo`) must be specified
--> $DIR/assoc_type_bounds2.rs:10:16
|
LL | type Bar
| -------- `Bar` defined here
...
LL | fn foo(_: &dyn Foo<()>) {}
| ^^^^^^^ help: specify the associated type: `Foo<(), Bar = Type>`

error[E0191]: the value of the associated type `Bar` (from trait `Foo`) must be specified
--> $DIR/assoc_type_bounds2.rs:11:16
|
LL | type Bar
| -------- `Bar` defined here
...
LL | fn bar(_: &dyn Foo<i32>) {}
| ^^^^^^^^ help: specify the associated type: `Foo<i32, Bar = Type>`

error: aborting due to 2 previous errors

For more information about this error, try `rustc --explain E0191`.
9 changes: 9 additions & 0 deletions tests/ui/object-safety/assoc_type_bounds_sized.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
trait Foo {
type Bar
where
Self: Sized;
}

fn foo(_: &dyn Foo) {} //~ ERROR: the value of the associated type `Bar` (from trait `Foo`) must be specified

fn main() {}
12 changes: 12 additions & 0 deletions tests/ui/object-safety/assoc_type_bounds_sized.stderr
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
error[E0191]: the value of the associated type `Bar` (from trait `Foo`) must be specified
--> $DIR/assoc_type_bounds_sized.rs:7:16
|
LL | type Bar
| -------- `Bar` defined here
...
LL | fn foo(_: &dyn Foo) {}
| ^^^ help: specify the associated type: `Foo<Bar = Type>`

error: aborting due to previous error

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