Skip to content
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

convert \r\n -> \n in include_str! macro #63681

Closed
wants to merge 1 commit into from

Conversation

matklad
Copy link
Member

@matklad matklad commented Aug 18, 2019

Edit: lang team response #63681 (comment) (after 2019-10-03 meeting)


Ideally, the meaning of the program should be independent of the line
endings used, because, for example, git can change line endings during
a checkout.

We currently do line-ending conversion in almost all cases, with
include_str being an exception. This commit removes this exception,
bringing include_str closer in behavior to string literals.

Note that this is technically a breaking change.

In case that you really mean to include a string with DOS line
endings, you can use include_bytes! macro which is guaranteed to not
do any translation, like this

pub fn my_text() -> &'static str {
    unsafe {
        std::str::from_utf8_unchecked(MY_TEXT_BYTES);
    }
}

const MY_TEXT_BYTES: &[u8] = include_bytes("my_text.bin");

#[test]
fn test_encoding() {
    std::str::from_utf8(MY_TEXT_BYTES)
    .unwrap();
}

cc @petrochenkov, @rust-lang/lang

Some preliminary discussion in #63525 (comment)

@rust-highfive
Copy link
Collaborator

r? @alexcrichton

(rust_highfive has picked a reviewer for you, use r? to override)

@rust-highfive rust-highfive added the S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. label Aug 18, 2019
@Centril Centril added relnotes Marks issues that should be documented in the release notes of the next release. T-lang Relevant to the language team, which will review and decide on the PR/issue. I-nominated labels Aug 18, 2019
@Centril Centril added this to the 1.39 milestone Aug 18, 2019
@Centril
Copy link
Contributor

Centril commented Aug 18, 2019

Seems like a reasonable change to me and it removes exceptions (yay!).

Note that this is technically a breaking change.

Currently the crater queue is quite long, but do you want to crater it in any case?

I think this is small enough a change that we don't need an FCP but it seems good to discuss it a bit at least so I've nominated for the T-Lang meeting on Thursday (21:00 Stockholm/Paris time). Feel free to join that meeting.

@petrochenkov
Copy link
Contributor

So, the primary alternatives / extensions are:

  • Do the change, but simultaneously provide a new macro include_bytes_as_str that re-packages the read bytes as a str without any normalization, but with a static UTF-8 validity check.
  • Do the change, but add Python-style optional arguments to include_str - include_str!("path/to/file", normalize_eol=false, normalize_bom=true) to opt out of the default.

The choice between these extensions and doing nothing probably depends on what crater finds.

@petrochenkov
Copy link
Contributor

This change is very easily revertable and backportable if necessary, so we may get the necessary experimental results faster and better by landing it on nightly, rather than by running crater.

@rust-highfive
Copy link
Collaborator

The job x86_64-gnu-llvm-6.0 of your PR failed (raw log). Through arcane magic we have determined that the following fragments from the build log may contain information about the problem.

Click to expand the log.
2019-08-18T09:30:01.1517412Z ##[command]git remote add origin https://github.com/rust-lang/rust
2019-08-18T09:30:01.1717434Z ##[command]git config gc.auto 0
2019-08-18T09:30:01.1784073Z ##[command]git config --get-all http.https://github.com/rust-lang/rust.extraheader
2019-08-18T09:30:01.1842123Z ##[command]git config --get-all http.proxy
2019-08-18T09:30:01.1987271Z ##[command]git -c http.extraheader="AUTHORIZATION: basic ***" fetch --force --tags --prune --progress --no-recurse-submodules --depth=2 origin +refs/heads/*:refs/remotes/origin/* +refs/pull/63681/merge:refs/remotes/pull/63681/merge
---
2019-08-18T09:30:36.9770129Z do so (now or later) by using -b with the checkout command again. Example:
2019-08-18T09:30:36.9770178Z 
2019-08-18T09:30:36.9770375Z   git checkout -b <new-branch-name>
2019-08-18T09:30:36.9770414Z 
2019-08-18T09:30:36.9770459Z HEAD is now at d04a5bea1 Merge dffb9884e1479a09380ad1df23ce4fd3f458ba9d into ef1ecbefb8719e408150738664d443a73f757ffd
2019-08-18T09:30:36.9939413Z ##[section]Starting: Collect CPU-usage statistics in the background
2019-08-18T09:30:36.9942351Z ==============================================================================
2019-08-18T09:30:36.9942403Z Task         : Bash
2019-08-18T09:30:36.9942445Z Description  : Run a Bash script on macOS, Linux, or Windows
---
2019-08-18T10:34:30.1714909Z .................................................................................................... 1500/8928
2019-08-18T10:34:35.9478948Z .................................................................................................... 1600/8928
2019-08-18T10:34:49.2419425Z ................................i...............i................................................... 1700/8928
2019-08-18T10:34:57.1132015Z .................................................................................................... 1800/8928
2019-08-18T10:35:11.9174829Z ........................iiiii....................................................................... 1900/8928
2019-08-18T10:35:22.8933106Z .................................................................................................... 2100/8928
2019-08-18T10:35:25.5655650Z .................................................................................................... 2200/8928
2019-08-18T10:35:30.6364664Z .................................................................................................... 2300/8928
2019-08-18T10:35:37.6717122Z .................................................................................................... 2400/8928
---
2019-08-18T10:38:36.2171931Z .................................................................................................... 4600/8928
2019-08-18T10:38:43.5325442Z ........i...............i........................................................................... 4700/8928
2019-08-18T10:38:55.1457957Z .................................................................................................... 4800/8928
2019-08-18T10:39:01.2755225Z .................................................................................................... 4900/8928
2019-08-18T10:39:13.8157587Z .........................................................................................ii.ii...... 5000/8928
2019-08-18T10:39:23.7348839Z .................................................................................................... 5200/8928
2019-08-18T10:39:33.7394165Z .................................................................................................... 5300/8928
2019-08-18T10:39:40.8118861Z .............................................i...................................................... 5400/8928
2019-08-18T10:39:47.6553871Z .................................................................................................... 5500/8928
2019-08-18T10:39:47.6553871Z .................................................................................................... 5500/8928
2019-08-18T10:39:58.6695592Z .................................................................................................... 5600/8928
2019-08-18T10:40:11.6789346Z ......................................ii...i..ii...........i........................................ 5700/8928
2019-08-18T10:40:30.6828926Z .................................................................................................... 5900/8928
2019-08-18T10:40:35.7549078Z .................................................................................................... 6000/8928
2019-08-18T10:40:35.7549078Z .................................................................................................... 6000/8928
2019-08-18T10:40:49.4047455Z .......................................i..ii........................................................ 6100/8928
2019-08-18T10:41:11.1586565Z .................................................................................i.................. 6300/8928
2019-08-18T10:41:13.4629637Z .................................................................................................... 6400/8928
2019-08-18T10:41:15.8812170Z .....................................................i.............................................. 6500/8928
2019-08-18T10:41:19.1679921Z .................................................................................................... 6600/8928
---
2019-08-18T10:42:21.2634053Z .................................................................................................... 7200/8928
2019-08-18T10:42:28.3697969Z .................................................................................................... 7300/8928
2019-08-18T10:42:38.8921258Z .................................................................................................... 7400/8928
2019-08-18T10:42:48.7613303Z .................................................................................................... 7500/8928
2019-08-18T10:42:55.8088406Z .ii......i.......................................................................................... 7600/8928
2019-08-18T10:43:17.5411503Z .................................................................................................... 7800/8928
2019-08-18T10:43:26.6807945Z .................................................................................................... 7900/8928
2019-08-18T10:43:36.5100485Z .................................................................................................... 8000/8928
2019-08-18T10:44:16.9993790Z .................................................................................................... 8100/8928
---
2019-08-18T10:45:22.7236156Z 
2019-08-18T10:45:22.7236605Z ------------------------------------------
2019-08-18T10:45:22.7236862Z stderr:
2019-08-18T10:45:22.7237282Z ------------------------------------------
2019-08-18T10:45:22.7237897Z thread 'main' panicked at 'assertion failed: source.contains("string\r\nliteral")', /checkout/src/test/ui/lexer-crlf-line-endings-string-literal-doc-comment.rs:40:5
2019-08-18T10:45:22.7238640Z 
2019-08-18T10:45:22.7239745Z ------------------------------------------
2019-08-18T10:45:22.7240025Z 
2019-08-18T10:45:22.7240217Z 
---
2019-08-18T10:45:22.7269787Z thread 'main' panicked at 'Some tests failed', src/tools/compiletest/src/main.rs:536:22
2019-08-18T10:45:22.7270218Z note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace.
2019-08-18T10:45:22.7288298Z 
2019-08-18T10:45:22.7289091Z 
2019-08-18T10:45:22.7292716Z command did not execute successfully: "/checkout/obj/build/x86_64-unknown-linux-gnu/stage0-tools-bin/compiletest" "--compile-lib-path" "/checkout/obj/build/x86_64-unknown-linux-gnu/stage2/lib" "--run-lib-path" "/checkout/obj/build/x86_64-unknown-linux-gnu/stage2/lib/rustlib/x86_64-unknown-linux-gnu/lib" "--rustc-path" "/checkout/obj/build/x86_64-unknown-linux-gnu/stage2/bin/rustc" "--src-base" "/checkout/src/test/ui" "--build-base" "/checkout/obj/build/x86_64-unknown-linux-gnu/test/ui" "--stage-id" "stage2-x86_64-unknown-linux-gnu" "--mode" "ui" "--target" "x86_64-unknown-linux-gnu" "--host" "x86_64-unknown-linux-gnu" "--llvm-filecheck" "/usr/lib/llvm-6.0/bin/FileCheck" "--host-rustcflags" "-Crpath -O -Cdebuginfo=0 -Zunstable-options  -Lnative=/checkout/obj/build/x86_64-unknown-linux-gnu/native/rust-test-helpers" "--target-rustcflags" "-Crpath -O -Cdebuginfo=0 -Zunstable-options  -Lnative=/checkout/obj/build/x86_64-unknown-linux-gnu/native/rust-test-helpers" "--docck-python" "/usr/bin/python2.7" "--lldb-python" "/usr/bin/python2.7" "--gdb" "/usr/bin/gdb" "--quiet" "--llvm-version" "6.0.0\n" "--system-llvm" "--cc" "" "--cxx" "" "--cflags" "" "--llvm-components" "" "--llvm-cxxflags" "" "--adb-path" "adb" "--adb-test-dir" "/data/tmp/work" "--android-cross-path" "" "--color" "always"
2019-08-18T10:45:22.7294723Z 
2019-08-18T10:45:22.7295274Z 
2019-08-18T10:45:22.7305813Z failed to run: /checkout/obj/build/bootstrap/debug/bootstrap test
2019-08-18T10:45:22.7305948Z Build completed unsuccessfully in 1:08:12
2019-08-18T10:45:22.7305948Z Build completed unsuccessfully in 1:08:12
2019-08-18T10:45:22.7360682Z == clock drift check ==
2019-08-18T10:45:22.7376830Z   local time: Sun Aug 18 10:45:22 UTC 2019
2019-08-18T10:45:23.0155082Z   network time: Sun, 18 Aug 2019 10:45:23 GMT
2019-08-18T10:45:23.0155192Z == end clock drift check ==
2019-08-18T10:45:24.1354669Z ##[error]Bash exited with code '1'.
2019-08-18T10:45:24.1420490Z ##[section]Starting: Checkout
2019-08-18T10:45:24.1422281Z ==============================================================================
2019-08-18T10:45:24.1422337Z Task         : Get sources
2019-08-18T10:45:24.1422385Z Description  : Get sources from a repository. Supports Git, TfsVC, and SVN repositories.

I'm a bot! I can only do what humans tell me to, so if this was not helpful or you have suggestions for improvements, please ping or otherwise contact @TimNN. (Feature Requests)

@Centril
Copy link
Contributor

Centril commented Aug 18, 2019

r? @petrochenkov

Ideally, the meaning of the program should be independent of the line
endings used, because, for example, git can change line endings during
a checkout.

We currently do line-ending conversion in almost all cases, with
`include_str` being an exception. This commit removes this exception,
bringing `include_str` closer in behavior to string literals.

Note that this is technically a breaking change.

In case that you really mean to include a string with DOS line
endings, you can use `include_bytes!` macro which is guaranteed to not
do any translation, like this

    pub fn my_text() -> &'static str {
        unsafe {
            std::str::from_utf8_unchecked(MY_TEXT_BYTES);
        }
    }

    const MY_TEXT_BYTES: &[u8] = include_bytes("my_text.bin");

    #[test]
    fn test_encoding() {
        std::str::from_utf8(MY_TEXT_BYTES)
	    .unwrap();
    }
@eddyb
Copy link
Member

eddyb commented Aug 18, 2019

for example, git can change line endings during a checkout

Yay bad defaults strike again... even if there are ways to ensure the right behavior in git (convert \r\n -> \n when committing only on windows, and only for certain files, and don't do anything else).

I don't have much against this change, although I will say we should make str::from_utf8(b"...").unwrap() work in constants already... (but also, isn't the unchecked version const fn? if so, why?)

@@ -7,6 +7,6 @@ fn main() {
);
assert_eq!(
include_str!("data.bin"),
"\u{FEFF}This file starts with BOM.\r\nLines are separated by \\r\\n.\r\n",
"This file starts with BOM.\nLines are separated by \\r\\n.\n",
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

"Lines are separated by \\n."

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nope, it should be \\r\\n, escaped \r is not changed in any way.

@petrochenkov petrochenkov added S-waiting-on-team Status: Awaiting decision from the relevant subteam (see the T-<team> label). and removed S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. labels Aug 18, 2019
@nagisa
Copy link
Member

nagisa commented Aug 19, 2019

This is a breaking change. Unlike with include!, it is trivial to observe "normalization" happening in include_str and include_bytes.

@petrochenkov
Copy link
Contributor

For include! it's pretty trivial as well, just include something with a multi-line string literal.

@matklad
Copy link
Member Author

matklad commented Aug 20, 2019

@petrochenkov I don't think so: line endings in multiline string literals are not observable, regardless of the way you get the literal.

@petrochenkov
Copy link
Contributor

I mean the normalization is observable, the literals have \r\ns in the included file and \n in AST, same case as with include_str after this PR.

@Centril
Copy link
Contributor

Centril commented Aug 29, 2019

cc @retep998

@petrochenkov
Copy link
Contributor

Regarding prior art on Windows, MSVC normalizes \r\n to \n, even in raw strings.

Rust always normalizes too (including raw strings), with include_str being the only exception.
(include_str is also a raw string, just loaded from a separate file.)

@joshtriplett
Copy link
Member

Another alternative: we could add a new include_text! or similar that does normalize, and continue to not normalize include_str!.

@retep998
Copy link
Member

retep998 commented Sep 6, 2019

I personally am not opposed to changing include_str! to normalize newlines, especially since we normalize them everywhere else anyway.

@nikomatsakis
Copy link
Contributor

Hey all,

we discussed this in the @rust-lang/lang meeting. It seemed to us that it would be a good topic for an RFC, as the best decision is not entirely obvious. In particular it'd be good to get a survey of how similar features work in other languages.

I think there was some general discomfort with changing the behavior here -- I guess it comes down to whether one considers the existing behavior a "bug" or a "feature". Going with another name (and probably deprecating the existing function) might obviate that concern. A stamp of approval from RFC commentors might also help.

If you think this is unreasonable, feel free to complain.

(Side question that occurs to me now: this seems like one of those "kind of lang kind of libs" questions, so I'd also like to hear what @rust-lang/libs members think about this question.)

@Centril Centril modified the milestones: 1.39, 1.40 Sep 26, 2019
@casey
Copy link
Contributor

casey commented Sep 26, 2019

I would personally find it very surprising if include_str! applied any sort of transformation. In my mind, as others have said, there is a very strong differences between string literals and static strings produced by include_str!.

As Koute said, Git's special handling of line endings is a big misfeature, and it seems strange to design around it. (And will probably be used less and less, with even Notepad supporting unix line endings.)

In particular, I would be worried about any situation involving hashes and digital signatures. If data included with include_str! is expected to have a particular hash, or will be checked to validate against a particular signature, changing \r\n to \n will change the hash of the data, and also invalidate the signature. I think that this would be extremely confusing to catch and debug.

@traviscross
Copy link
Contributor

CRLFs aren't just a Windows thing, unfortunately. Most IETF network protocols (e.g. HTTP, SMTP, SIP, etc.) require CRLF line breaks. It's common to store protocol snippets in files for various testing purposes, and these files invariably contain the CRLFs. Some libraries treat these kind of protocols as binary, but others treat them as UTF-8 and may use include_str!.

@casey's point about breaking hashes and digital signatures is also a very serious concern.

In Rust source files, newline normalization is indeed the right thing to do. But making include_str! inconsistent with read_to_string would be very surprising.

@petrochenkov
Copy link
Contributor

If there are use cases for unnormalized UTF-8, then we need include_bytes_as_str, the primary use of string inclusion is still including something that's "just source code".

The result of read_to_string usually needs to be normalized as well, except that in Rust you have to do it manually (unlike in C/C++ or Python where it's normalized automatically, unless you explicitly read the file in binary mode).
(In particular, that normalization happens if you simply throw away all whitespace symbols regardless of their kinds, which is a common case.)
So, it's probably read_to_string that's the weird one here.

@BurntSushi
Copy link
Member

I'm also opposed to this change. A lot of the discussion here seems to be focused around the notion that:

  • include_bytes! is available for cases that don't want normalization.
  • String literals in Rust source files already do this normalization.

Both points are eminently reasonable, and indeed, I might even be swayed by them if we had a do-over and were able to redesign these APIs in a vacuum. But we're not. I'm opposed to this change not only because it's a breaking change, but it's a very subtle breaking change. It's the kind of breaking change that won't easily be detected, but could prove quite frustrating to folks who stumble over it. IMO, these kinds of cases---where one might reasonably call this an inconsistent wart---are precisely where we should be doubling down on our commitment to stability. On the one hand, we have a wart that we might be able to fix with fairly little breakage in practice. But on the other hand, we have a wart that doesn't seem to be causing any substantial frustration in practice, other than one perhaps deeming it inconsistent. From my perspective, that's not worth breaking our commitment to stability.

I'd also like to address some other minor points:

@joshtriplett

Another alternative: we could add a new include_text! or similar that does normalize, and continue to not normalize include_str!.

If we were convinced that we wanted to solve this problem, then yes, I agree this would be a better alternative than changing the behavior of include_str!. With that said, I'm not convinced this problem is big enough that it's worth introducing the API confusion of having two macros that do very similar things.

@petrochenkov

Precedent: the same change was done for raw string literals a few releases ago without much noise, and we still haven't seen any complaints.

So, I secretly wish we landed this sneakily as well, then nobody would ever notice the change. So, this PR receives the amount of attention it doesn't deserve.

Could you help me understand this a bit more? Are you saying that a breaking change was made to the semantics of raw string literals without going through an FCP? That seems like a process break down, and explicitly not something to cite as a precdent.

@koute
Copy link
Member

koute commented Sep 29, 2019

the primary use of string inclusion is still including something that's "just source code"

Do you have any evidence which confirms this? Virtually every time I use include_str! I use it to include data, not code. But maybe I'm the odd one out here?

unlike in C/C++ or Python where it's normalized automatically, unless you explicitly read the file in binary mode

In case of C this is a huge misfeature, as then the behavior of your program becomes subtly different depending on which OS you're running on (e.g. on UNIX-like systems fopen always works in binary mode, where on Windows it will mangle the newlines in text mode and subtly break fseek), so the best practice there is pretty much "always read in binary mode, and if you need to normalize it in any way explicitly do it yourself".

@rfcbot rfcbot added finished-final-comment-period The final comment period is finished for this PR / Issue. and removed final-comment-period In the final comment period and will be merged soon unless new substantive objections are raised. labels Sep 29, 2019
@rfcbot
Copy link

rfcbot commented Sep 29, 2019

The final comment period, with a disposition to merge, as per the review above, is now complete.

As the automated representative of the governance process, I would like to thank the author for their work and everyone else who contributed.

The RFC will be merged soon.

@jhpratt
Copy link
Member

jhpratt commented Sep 29, 2019

How on earth is the disposition merge? There are a number of outstanding issues that myself and others have brought up, including breaking the back-compatibility promise of Rust.

@nagisa
Copy link
Member

nagisa commented Sep 29, 2019

This is just an automated, time-based message based on #63681 (comment). It occurred as none of the concerns were registered with rfcbot.

@casey
Copy link
Contributor

casey commented Sep 29, 2019

the primary use of string inclusion is still including something that's "just source code".

Looking over my own code, all my use of include_str! is to include e.g. JSON, YAML, or plain text, and no uses of include_str! for source code. Searching GitHub yields similar results.

Also, it's not obvious to me that there is any advantage in having include_str! replace \r\n with \n in Rust source code. If Rust source code is loaded with include_str!, it will still be loaded at some point in the future by rustc, which will treat \r\n and \n as equivalent.

Given my current understanding, this change is all downside with very little upside. Is internal consistency the only motivating factor for this change?

@casey
Copy link
Contributor

casey commented Sep 29, 2019

Also, just a note that \r\n to \n is not done by any of Unicode's defined normalization algorithms, even the most aggressive compatibility modes:

Original: "hello\r\ngoodbye\r\n"
NFD:      "hello\r\ngoodbye\r\n"
NFC:      "hello\r\ngoodbye\r\n"
NFKD:     "hello\r\ngoodbye\r\n"
NFKC:     "hello\r\ngoodbye\r\n"

(Just noting this because I was a little confused by the term "normalization" being used to include \r\n to \n replacement.)

@petrochenkov
Copy link
Contributor

Looking over my own code, all my use of include_str! is to include e.g. JSON, YAML, or plain text, and no uses of include_str! for source code. Searching GitHub yields similar results.

All of those fit into "just source code" in my terminology, and want newlines converted, and in theory may be written inline rather than in separate files.
Also, markdown, XML, css, OpenCL C, etc.

@petrochenkov
Copy link
Contributor

@BurntSushi

Could you help me understand this a bit more? Are you saying that a breaking change was made to the semantics of raw string literals without going through an FCP? That seems like a process break down, and explicitly not something to cite as a precdent.

Well, things like this are often at the reviewer's discretion and depend on estimated impact, many compiler changes affect observable behavior in specially crafted corner cases, if we FCP them all we won't move anywhere.
If the estimate turns out wrong, then per-release crater runs show regressions, which are then fixed or closed as wontfix (perhaps with an FCP).

@koute

Do you have any evidence which confirms this?

#63681 (comment)

@BurntSushi
Copy link
Member

Well, things like this are often at the reviewer's discretion and depend on estimated impact, many compiler changes affect observable behavior in specially crafted corner cases, if we FCP them all we won't move anywhere.

Yeah I get that. I'm looking for a clarification here, as I want to make sure I'm understanding right. It sounds like that change was made to the language, as it impacts the semantics of how raw strings are interpreted. Are those kinds of changes regularly made without some kind of consensus from the lang team? It seems like it rises well beyond a tweak in observable compiler behavior.

@casey
Copy link
Contributor

casey commented Sep 29, 2019

All of those fit into "just source code" in my terminology, and want newlines converted, and in theory may be written inline rather than in separate files.
Also, markdown, XML, css, OpenCL C, etc.

I think it's reasonable for the Rust toolchain to make assumptions about Rust source code, but I don't think is's a good idea to make assumptions about non-Rust source code.

Here is an example of non-Rust source code distinguishing between \r\n and \n which would be broken by the proposed modification to include_str!. Labels in windows batch files will not work if \n line endings are used.

@scottmcm
Copy link
Member

scottmcm commented Oct 3, 2019

Thank you to everyone who commented during the Final Comment Period here. The FCP exists exactly for situations like this, to bring attention to changes and give time for everyone to bring up additional data and concerns that may not have been raised before.

We discussed this in the lang team meeting today, and decided that in light of the situations raised the breakage is more than we're willing to take, so we will not go forward with the change.

@rfcbot fcp cancel

If anyone is interested in this still happening, or otherwise enabling the "does the same thing despite git checkout platform" scenario, one could open an RFC to do this over an edition boundary, add a new macro, do something in the library, or a variety of other possibilities.

@rfcbot
Copy link

rfcbot commented Oct 3, 2019

@scottmcm proposal cancelled.

@rfcbot rfcbot removed the disposition-merge This issue / PR is in PFCP or FCP with a disposition to merge it. label Oct 3, 2019
@jhpratt
Copy link
Member

jhpratt commented Oct 3, 2019

^^ For what it's worth, it would be relatively trivial to implement this proposal as a proc macro.

@scottmcm
Copy link
Member

scottmcm commented Oct 4, 2019

As a follow-up question: Is there any linting that people would expect here? For example, there could be a lint for inconsistent newlines in include_str!, or clippy ones for any CRLF in them, or...

(Commenting separately from my previous "official" one, since this is just me wondering.)

@jhpratt
Copy link
Member

jhpratt commented Oct 4, 2019

I think a lint, either enable-by-default or in clippy would make sense. Even for most situations where \r\n is expected, that's normally all that's expected.

@nikomatsakis
Copy link
Contributor

Based on our previous comment, I'm going to go ahead and close this PR. Thanks @matklad for the suggestion.

@Centril Centril added the A-maybe-future-edition Something we may consider for a future edition. label Oct 24, 2019
@Centril Centril removed this from the 1.40 milestone Nov 7, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-maybe-future-edition Something we may consider for a future edition. finished-final-comment-period The final comment period is finished for this PR / Issue. relnotes Marks issues that should be documented in the release notes of the next release. S-waiting-on-team Status: Awaiting decision from the relevant subteam (see the T-<team> label). T-lang Relevant to the language team, which will review and decide on the PR/issue.
Projects
None yet
Development

Successfully merging this pull request may close these issues.