forked from rust-lang/rust
-
Notifications
You must be signed in to change notification settings - Fork 0
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#53016 - scottmcm:impl-header-lifetime-elision…
…, r=nikomatsakis Extract impl_header_lifetime_elision out of in_band_lifetimes This way we can experiment with `impl Debug for &MyType` separately from `impl Debug for &'a MyType`. I can't say I know what the code in here is doing, so please let me know if there's a better way 🙂 I marked this as enabled in 2018 so that edition code continues to work without another flag. Actual feature PR rust-lang#49251; Tracking Issue rust-lang#15872; In-band lifetimes tracking issue rust-lang#44524. cc @aturon, per discussion on discord earlier cc @cramertj & @nikomatsakis, who actually wrote these features
- Loading branch information
Showing
21 changed files
with
88 additions
and
32 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
27 changes: 27 additions & 0 deletions
27
src/test/ui/feature-gate-impl_header_lifetime_elision-with-in_band.rs
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 @@ | ||
// Copyright 2017 The Rust Project Developers. See the COPYRIGHT | ||
// file at the top-level directory of this distribution and at | ||
// http://rust-lang.org/COPYRIGHT. | ||
// | ||
// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or | ||
// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license | ||
// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your | ||
// option. This file may not be copied, modified, or distributed | ||
// except according to those terms. | ||
|
||
#![allow(warnings)] | ||
|
||
// Make sure this related feature didn't accidentally enable this | ||
#![feature(in_band_lifetimes)] | ||
|
||
trait MyTrait<'a> { } | ||
|
||
impl MyTrait<'a> for &u32 { } | ||
//~^ ERROR missing lifetime specifier | ||
|
||
struct MyStruct; | ||
trait MarkerTrait {} | ||
|
||
impl MarkerTrait for &'_ MyStruct { } | ||
//~^ ERROR missing lifetime specifier | ||
|
||
fn main() {} |
15 changes: 15 additions & 0 deletions
15
src/test/ui/feature-gate-impl_header_lifetime_elision-with-in_band.stderr
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,15 @@ | ||
error[E0106]: missing lifetime specifier | ||
--> $DIR/feature-gate-impl_header_lifetime_elision-with-in_band.rs:18:22 | ||
| | ||
LL | impl MyTrait<'a> for &u32 { } | ||
| ^ expected lifetime parameter | ||
|
||
error[E0106]: missing lifetime specifier | ||
--> $DIR/feature-gate-impl_header_lifetime_elision-with-in_band.rs:24:23 | ||
| | ||
LL | impl MarkerTrait for &'_ MyStruct { } | ||
| ^^ expected lifetime parameter | ||
|
||
error: aborting due to 2 previous errors | ||
|
||
For more information about this error, try `rustc --explain E0106`. |
File renamed without changes.
4 changes: 2 additions & 2 deletions
4
...eature-gate-in_band_lifetimes-impl.stderr → ...-gate-impl_header_lifetime_elision.stderr
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
File renamed without changes.
File renamed without changes.
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
File renamed without changes.
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
File renamed without changes.
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
File renamed without changes.
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