Skip to content
Closed
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
35 commits
Select commit Hold shift + click to select a range
612ef5f
add new tests for re_rebalance_coherence
nikomatsakis Sep 12, 2019
e69d1b6
change to check-pass
nikomatsakis Sep 13, 2019
3f004a1
Fix re-rebalance coherence implementation for fundamental types
weiznich Sep 17, 2019
a9c38d9
Add more tests
weiznich Sep 18, 2019
31b3012
Split line to fix tidy
weiznich Sep 18, 2019
3ee2920
Fix some unused variable warnings
weiznich Sep 22, 2019
d2762ac
Differentiate AArch64 bare-metal targets between hf and non-hf.
andre-richter Sep 18, 2019
2666ae5
Remove whitespace from testname
weiznich Sep 23, 2019
9249a73
More path name fixes
weiznich Sep 24, 2019
68d099a
Create new error code E0734 for stability attributes used outside of …
GuillaumeGomez Sep 25, 2019
33b89a3
Add long error explanation for E0531
GuillaumeGomez Sep 14, 2019
2fd3811
update ui tests
GuillaumeGomez Sep 14, 2019
0ebb044
Add long error explanation for E0734
GuillaumeGomez Sep 25, 2019
2e78683
Update ui tests
GuillaumeGomez Sep 25, 2019
ecfe92f
Don't check error_codes files for lints
GuillaumeGomez Sep 27, 2019
bc17936
[const-prop] Replace `eval_place()` with use of `InterpCx`
wesleywiser Sep 4, 2019
86c7c4d
[const-prop] Replace `Use` handling with use of `InterpCx`
wesleywiser Sep 6, 2019
ecc4cc2
[const-prop] Replace `Cast` handling with use of `InterpCx`
wesleywiser Sep 6, 2019
1c219bb
[const-prop] Replace `NullaryOp` handling with use of `InterpCx`
wesleywiser Sep 6, 2019
644d4f3
[const-prop] Replace most `UnaryOp` handling with use of `InterpCx`
wesleywiser Sep 6, 2019
11eb91f
[const-prop] Replace `CheckedBinaryOp` handling with use of `InterpCx`
wesleywiser Sep 9, 2019
9ec928c
[const-prop] Replace some `Binaryp` handling with use of `InterpCx`
wesleywiser Sep 10, 2019
c0c8ce8
[const-prop] Replace `Ref` handling with use of `InterpCx`
wesleywiser Sep 11, 2019
fadfd92
Don't run the ConstProp MIR pass on generators
wesleywiser Sep 13, 2019
15d2b7a
Respond to code review feedback and fix tidy
wesleywiser Sep 13, 2019
9333514
Move Ref-from-arg checking from `step.rs` to `const_prop.rs`
wesleywiser Sep 14, 2019
4e58e2e
Work around for #64506
wesleywiser Sep 17, 2019
dcc6c28
Introduce a `ConstPropMachine`
wesleywiser Sep 25, 2019
3e9bab2
Allow reading non-mutable statics in const prop
wesleywiser Sep 25, 2019
dd486dd
Fix lint-exceeding-bitshifts ui tests
wesleywiser Sep 28, 2019
dccc8b4
Rollup merge of #64419 - wesleywiser:const_prop_use_ecx, r=oli-obk
Centril Sep 28, 2019
98ddcdc
Rollup merge of #64455 - GuillaumeGomez:long-error-explanation-E0531,…
Centril Sep 28, 2019
8a15ef5
Rollup merge of #64546 - weiznich:bugfix/rfc-2451-rerebalance-tests, …
Centril Sep 28, 2019
f4fc2e6
Rollup merge of #64589 - andre-richter:aarch64_bare_metal, r=Amanieu
Centril Sep 28, 2019
d4d3d97
Rollup merge of #64763 - GuillaumeGomez:long-err-explanation-E0734, r…
Centril Sep 28, 2019
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
Fix re-rebalance coherence implementation for fundamental types
Fixes #64412
  • Loading branch information
weiznich committed Sep 17, 2019
commit 3f004a1bc44859857f05a9f692a578124b3f3e01
10 changes: 9 additions & 1 deletion src/librustc/traits/coherence.rs
Original file line number Diff line number Diff line change
Expand Up @@ -378,7 +378,15 @@ fn orphan_check_trait_ref<'tcx>(
// Let Ti be the first such type.
// - No uncovered type parameters P1..=Pn may appear in T0..Ti (excluding Ti)
//
for input_ty in trait_ref.input_types() {
fn uncover_fundamental_ty(ty: Ty<'_>) -> Vec<Ty<'_>> {
if fundamental_ty(ty) {
ty.walk_shallow().flat_map(|ty| uncover_fundamental_ty(ty)).collect()
} else {
vec![ty]
}
}

for input_ty in trait_ref.input_types().flat_map(uncover_fundamental_ty) {
debug!("orphan_check_trait_ref: check ty `{:?}`", input_ty);
if ty_is_local(tcx, input_ty, in_crate) {
debug!("orphan_check_trait_ref: ty_is_local `{:?}`", input_ty);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@

// compile-flags:--crate-name=test
// aux-build:coherence_lib.rs
// check-pass

extern crate coherence_lib as lib;
use lib::*;
Expand All @@ -11,11 +10,11 @@ use std::rc::Rc;
struct Local;

impl<T> Remote1<Local> for Box<T> {
// FIXME(#64412) -- this is expected to error
//~^ ERROR type parameter `T` must be used as the type parameter for some local type
}

impl<T> Remote1<Local> for &T {
// FIXME(#64412) -- this is expected to error
//~^ ERROR type parameter `T` must be used as the type parameter for some local type
}

fn main() {}
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
error[E0210]: type parameter `T` must be used as the type parameter for some local type (e.g., `MyStruct<T>`)
--> $DIR/impl[t]-foreign[local]-for-fundamental[t].rs:12:1
|
LL | impl<T> Remote1<Local> for Box<T> {
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ type parameter `T` must be used as the type parameter for some local type
|
= note: only traits defined in the current crate can be implemented for a type parameter

error[E0210]: type parameter `T` must be used as the type parameter for some local type (e.g., `MyStruct<T>`)
--> $DIR/impl[t]-foreign[local]-for-fundamental[t].rs:16:1
|
LL | impl<T> Remote1<Local> for &T {
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ type parameter `T` must be used as the type parameter for some local type
|
= note: only traits defined in the current crate can be implemented for a type parameter

error: aborting due to 2 previous errors

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