forked from rust-lang/rust
-
Notifications
You must be signed in to change notification settings - Fork 7
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Auto merge of rust-lang#101296 - compiler-errors:head-span-for-enclos…
…ing-scope, r=oli-obk Use head span for `rustc_on_unimplemented`'s `enclosing_scope` attr This may make rust-lang#101281 slightly easier to understand
- Loading branch information
Showing
14 changed files
with
287 additions
and
288 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
// Test scope annotations from `parent_label` parameter | ||
|
||
#![feature(rustc_attrs)] | ||
|
||
#[rustc_on_unimplemented(parent_label = "in this scope")] | ||
trait Trait {} | ||
|
||
struct Foo; | ||
|
||
fn f<T: Trait>(x: T) {} | ||
|
||
fn main() { | ||
let x = || { | ||
f(Foo {}); //~ ERROR the trait bound `Foo: Trait` is not satisfied | ||
let y = || { | ||
f(Foo {}); //~ ERROR the trait bound `Foo: Trait` is not satisfied | ||
}; | ||
}; | ||
|
||
{ | ||
{ | ||
f(Foo {}); //~ ERROR the trait bound `Foo: Trait` is not satisfied | ||
} | ||
} | ||
|
||
f(Foo {}); //~ ERROR the trait bound `Foo: Trait` is not satisfied | ||
} |
Oops, something went wrong.