Skip to content
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.

Commit 026447b

Browse files
committedOct 12, 2019
Auto merge of #65322 - tmandry:rollup-frr651r, r=tmandry
Rollup of 15 pull requests Successful merges: - #64337 (libstd: Fix typos in doc) - #64986 (Function pointers as const generic arguments) - #65048 (Added doc about behavior of extend on HashMap) - #65191 (Add some regression tests) - #65200 (Add ?Sized bound to a supertrait listing in E0038 error documentation) - #65205 (Add long error explanation for E0568) - #65220 (Update LLVM for Emscripten exception handling support) - #65263 (Deduplicate is_{freeze,copy,sized}_raw) - #65266 (Mark Path::join as must_use) - #65276 (Don't cc rust-lang/compiler for toolstate changes) - #65277 (Query generator kind for error reporting) - #65283 (stability: Do not use `buffer_lint` after lowering to HIR) - #65289 (Fix suggested bound addition diagnostic) - #65310 (deriving: avoid dummy Span on an artificial `type_ident` path) - #65321 (Remove painful test that is not pulling its weight) Failed merges: r? @ghost
2 parents 4b42e91 + b93203f commit 026447b

File tree

71 files changed

+731
-281
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

71 files changed

+731
-281
lines changed
 

‎src/librustc/error_codes.rs

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -259,8 +259,8 @@ trait Foo {
259259
This is similar to the second sub-error, but subtler. It happens in situations
260260
like the following:
261261
262-
```compile_fail
263-
trait Super<A> {}
262+
```compile_fail,E0038
263+
trait Super<A: ?Sized> {}
264264
265265
trait Trait: Super<Self> {
266266
}
@@ -270,17 +270,21 @@ struct Foo;
270270
impl Super<Foo> for Foo{}
271271
272272
impl Trait for Foo {}
273+
274+
fn main() {
275+
let x: Box<dyn Trait>;
276+
}
273277
```
274278
275279
Here, the supertrait might have methods as follows:
276280
277281
```
278-
trait Super<A> {
279-
fn get_a(&self) -> A; // note that this is object safe!
282+
trait Super<A: ?Sized> {
283+
fn get_a(&self) -> &A; // note that this is object safe!
280284
}
281285
```
282286
283-
If the trait `Foo` was deriving from something like `Super<String>` or
287+
If the trait `Trait` was deriving from something like `Super<String>` or
284288
`Super<T>` (where `Foo` itself is `Foo<T>`), this is okay, because given a type
285289
`get_a()` will definitely return an object of that type.
286290

‎src/librustc/hir/mod.rs

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1366,6 +1366,10 @@ impl Body {
13661366
hir_id: self.value.hir_id,
13671367
}
13681368
}
1369+
1370+
pub fn generator_kind(&self) -> Option<GeneratorKind> {
1371+
self.generator_kind
1372+
}
13691373
}
13701374

13711375
/// The type of source expression that caused this generator to be created.

0 commit comments

Comments
 (0)
Please sign in to comment.