Auto merge of #62659 - Centril:rollup-90oz643, r=Centril
Rollup of 5 pull requests Successful merges: - #62577 (Add an AtomicCell abstraction) - #62585 (Make struct_tail normalize when possible) - #62604 (Handle errors during error recovery gracefully) - #62636 (rustbuild: Improve assert about building tools once) - #62651 (Make some rustc macros more hygienic) Failed merges: r? @ghost
This commit is contained in:
commit
69656fa4cb
32 changed files with 313 additions and 88 deletions
|
|
@ -1,9 +1,9 @@
|
|||
#![feature(rustc_attrs, rustc_private, step_trait)]
|
||||
#![feature(rustc_private)]
|
||||
|
||||
#[macro_use] extern crate rustc_data_structures;
|
||||
extern crate rustc_data_structures;
|
||||
extern crate serialize as rustc_serialize;
|
||||
|
||||
use rustc_data_structures::indexed_vec::Idx;
|
||||
use rustc_data_structures::{newtype_index, indexed_vec::Idx};
|
||||
|
||||
newtype_index!(struct MyIdx { MAX = 0xFFFF_FFFA });
|
||||
|
||||
|
|
|
|||
|
|
@ -0,0 +1,35 @@
|
|||
// rust-lang/rust#60431: This is a scenario where to determine the size of
|
||||
// `&Ref<Obstack>`, we need to know the concrete type of the last field in
|
||||
// `Ref<Obstack>` (i.e. its "struct tail"), and determining that concrete type
|
||||
// requires normalizing `Obstack::Dyn`.
|
||||
//
|
||||
// The old "struct tail" computation did not perform such normalization, and so
|
||||
// the compiler would ICE when trying to figure out if `Ref<Obstack>` is a
|
||||
// dynamically-sized type (DST).
|
||||
|
||||
// run-pass
|
||||
|
||||
use std::mem;
|
||||
|
||||
pub trait Arena {
|
||||
type Dyn : ?Sized;
|
||||
}
|
||||
|
||||
pub struct DynRef {
|
||||
_dummy: [()],
|
||||
}
|
||||
|
||||
pub struct Ref<A: Arena> {
|
||||
_value: u8,
|
||||
_dyn_arena: A::Dyn,
|
||||
}
|
||||
|
||||
pub struct Obstack;
|
||||
|
||||
impl Arena for Obstack {
|
||||
type Dyn = DynRef;
|
||||
}
|
||||
|
||||
fn main() {
|
||||
assert_eq!(mem::size_of::<&Ref<Obstack>>(), mem::size_of::<&[()]>());
|
||||
}
|
||||
3
src/test/ui/parser/issue-62546.rs
Normal file
3
src/test/ui/parser/issue-62546.rs
Normal file
|
|
@ -0,0 +1,3 @@
|
|||
pub t(#
|
||||
//~^ ERROR missing `fn` or `struct` for function or struct definition
|
||||
//~ ERROR this file contains an un-closed delimiter
|
||||
17
src/test/ui/parser/issue-62546.stderr
Normal file
17
src/test/ui/parser/issue-62546.stderr
Normal file
|
|
@ -0,0 +1,17 @@
|
|||
error: this file contains an un-closed delimiter
|
||||
--> $DIR/issue-62546.rs:3:53
|
||||
|
|
||||
LL | pub t(#
|
||||
| - un-closed delimiter
|
||||
LL |
|
||||
LL |
|
||||
| ^
|
||||
|
||||
error: missing `fn` or `struct` for function or struct definition
|
||||
--> $DIR/issue-62546.rs:1:4
|
||||
|
|
||||
LL | pub t(#
|
||||
| ---^- help: if you meant to call a macro, try: `t!`
|
||||
|
||||
error: aborting due to 2 previous errors
|
||||
|
||||
Loading…
Add table
Add a link
Reference in a new issue