Skip to content

Rollup of 8 pull requests #98292

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

Merged
merged 27 commits into from
Jun 20, 2022
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
Show all changes
27 commits
Select commit Hold shift + click to select a range
967c0ad
Implement `IterMut::as_mut_slice`
SkiFire13 Jan 19, 2022
a23e751
Panic when advance_slices()'ing too far.
m-ou-se Mar 11, 2022
4d7daa0
Update advance and advance_slices docs.
m-ou-se Mar 11, 2022
1890372
Update tests.
m-ou-se Mar 11, 2022
1ac5440
add `{Arc, Rc}::downcast_unchecked`
ibraheemdev May 1, 2022
6d523e9
Fix the generator example for `pin!()`
mbartlett21 May 4, 2022
5ae95fa
Document Rust's stance on `/proc/self/mem`
sunfishcode Jun 7, 2022
fbb59e7
Update library/std/src/os/unix/io/mod.rs
sunfishcode Jun 7, 2022
52cb18b
Update library/std/src/os/unix/io/mod.rs
sunfishcode Jun 7, 2022
27d9ab4
Update library/std/src/os/unix/io/mod.rs
sunfishcode Jun 7, 2022
f9662f2
Update library/std/src/os/unix/io/mod.rs
sunfishcode Jun 7, 2022
7656e08
Reword a question into a statement.
sunfishcode Jun 8, 2022
e89ec68
Update library/std/src/os/unix/io/mod.rs
sunfishcode Jun 8, 2022
158ff5c
Reword the question in the section header too.
sunfishcode Jun 8, 2022
6959441
Fix trailing whitespace.
sunfishcode Jun 8, 2022
f725b97
Include ForeignItem when visiting types for WF check
PrestonFrom Jun 16, 2022
c867529
Show #![feature] in example.
m-ou-se Jun 20, 2022
8b93147
`Stdio::make_pipe`
ChrisDenton May 18, 2022
740a54c
Windows: `CommandExt::async_pipes`
ChrisDenton May 18, 2022
fd9ca0c
Rollup merge of #93080 - SkiFire13:itermut-as_mut_slice, r=m-ou-se
Dylan-DPC Jun 20, 2022
99620ad
Rollup merge of #94855 - m-ou-se:advance-slice-panic-docs, r=kennytm
Dylan-DPC Jun 20, 2022
7372bf8
Rollup merge of #96609 - ibraheemdev:arc-downcast-unchecked, r=m-ou-se
Dylan-DPC Jun 20, 2022
625c929
Rollup merge of #96719 - mbartlett21:patch-4, r=Dylan-DPC
Dylan-DPC Jun 20, 2022
85f1de2
Rollup merge of #97149 - ChrisDenton:win_async_pipes, r=m-ou-se
Dylan-DPC Jun 20, 2022
2807f28
Rollup merge of #97150 - ChrisDenton:stdio-create_pipe, r=m-ou-se
Dylan-DPC Jun 20, 2022
ce1151c
Rollup merge of #97837 - sunfishcode:sunfishcode/proc-self-mem, r=m-o…
Dylan-DPC Jun 20, 2022
7bde23b
Rollup merge of #98159 - PrestonFrom:issue_95665, r=petrochenkov
Dylan-DPC Jun 20, 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
5 changes: 4 additions & 1 deletion compiler/rustc_typeck/src/hir_wf_check.rs
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
use crate::collect::ItemCtxt;
use rustc_hir as hir;
use rustc_hir::intravisit::{self, Visitor};
use rustc_hir::HirId;
use rustc_hir::{ForeignItem, ForeignItemKind, HirId};
use rustc_infer::infer::TyCtxtInferExt;
use rustc_infer::traits::TraitEngine;
use rustc_infer::traits::{ObligationCause, WellFormedLoc};
Expand Down Expand Up @@ -141,6 +141,9 @@ fn diagnostic_hir_wf_check<'tcx>(
ref item => bug!("Unexpected item {:?}", item),
},
hir::Node::Field(field) => Some(field.ty),
hir::Node::ForeignItem(ForeignItem {
kind: ForeignItemKind::Static(ty, _), ..
}) => Some(*ty),
ref node => bug!("Unexpected node {:?}", node),
},
WellFormedLoc::Param { function: _, param_idx } => {
Expand Down
18 changes: 18 additions & 0 deletions src/test/ui/wf/issue-95665.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
// Regression test for the ICE described in #95665.
// Ensure that the expected error is output (and thus that there is no ICE)

pub trait Trait: {}

pub struct Struct<T: Trait> {
member: T,
}

// uncomment and bug goes away
// impl Trait for u8 {}

extern "C" {
static VAR: Struct<u8>;
//~^ 14:17: 14:27: the trait bound `u8: Trait` is not satisfied [E0277]
}

fn main() {}
15 changes: 15 additions & 0 deletions src/test/ui/wf/issue-95665.stderr
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
error[E0277]: the trait bound `u8: Trait` is not satisfied
--> $DIR/issue-95665.rs:14:17
|
LL | static VAR: Struct<u8>;
| ^^^^^^^^^^ the trait `Trait` is not implemented for `u8`
|
note: required by a bound in `Struct`
--> $DIR/issue-95665.rs:6:22
|
LL | pub struct Struct<T: Trait> {
| ^^^^^ required by this bound in `Struct`

error: aborting due to previous error

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